如何将 phabricator 配置为仅对匹配的文件进行 lint *py
?
以下是我的 .arclint 文件:
{
"linters": {
"pylint": {
"type": "pylint",
"include": "(\\.py$)"
}
}
}
这主要基于此处找到的示例:
https://secure.phabricator.com/book/phabricator/article/arcanist_lint/
当我运行它时,我得到这个:
$ arc lint
No paths are lintable.
如果我删除包含行,它会尝试对每个文件进行 lint,因此正则表达式肯定有问题:
"(\\.py$)"
老实说,这对我来说看起来很奇怪,但这正是我在示例中发现的。和 "(*.py)"
, "*.py"
, 和 "^*.py$"
都是无效的正则表达式。
最佳答案
所以事实证明,正则表达式实际上没有任何问题。我只是不使用 arc lint
正确。arc lint
命令仅尝试 lint 已修改的文件。我只是期待它表现得像 arc lint --everything
.
$ arc lint --help
lint [options] [paths]
lint [options] --rev [rev]
Supports: git, svn, hg
Run static analysis on changes to check for mistakes. If no files
are specified, lint will be run on all files which have been modified.
关于json - Phabricator linter 找不到任何 lintable 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33552895/