lua - Luacheck 包含排除目录中的文件
问题描述
我有一个这样的项目(其实还有更多的文件和目录):
.
├── src
│ ├── main.lua
│ └── smth.lua
└── tests
├── others
│ ├── others_1.lua
│ ├── others_2.lua
│ └── others_3.lua
├── speed_tests
│ ├── test1.lua
│ └── test2.lua
└── sql
├── join.lua
└── select.lua
我有这样的.luacheckrc
:
include_files = {
"**/*.lua"
}
exclude_files = {
"tests/**/*.lua",
}
我希望luacheck
实用程序检查目录中的tests/sql
文件,但不要触摸tests/
. 当然,我可以明确地写:
exclude_files = {
"tests/others/*.lua",
"tests/speed_tests/*.lua"
}
,但在实际项目中,有 15 个以上的目录,这样做看起来不太好。
如何优雅地达成目标?
解决方案
那时不要使用排除,只包含您希望遍历的目录。
include_files = {
"src/*.lua",
"tests/sql/*.lua"
}
推荐阅读
- c++ - 额外的行作为 C++ 中的输出出现
- c++ - 如何在 wxRichToolTip、wxWidgets 中添加按钮?
- python - 删除重复项并使用最旧的值完成 nan 并优化运行时间
- javascript - 拖入反应后如何显示下一张幻灯片?
- amazon-web-services - 如何将变量导入 AWS ApiGateway 的 Swagger 文件
- mysql - 在 WHERE 子句中使用计数值
- javascript - 在 HTML 字段中复制/粘贴字符串
- javascript - Discord.js 将单词嵌入
- ios - iOS 中的内存泄漏 Kotlin Native 库
- c# - Sharepoint online - 不返回列表中特定视图中的项目