Phabricator linter找不到任何可以通行的路径

Bre*_*dan 11 regex json pylint phabricator

如何将phabricator配置为仅lint匹配的文件*py?

以下是我的.arclint文件:

{
  "linters": {
    "pylint": {
      "type": "pylint",
      "include": "(\\.py$)"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

这主要基于以下示例:https: //secure.phabricator.com/book/phabricator/article/arcanist_lint/

当我运行它时,我得到了这个:

$ arc lint 
No paths are lintable.
Run Code Online (Sandbox Code Playgroud)

如果我删除include行,它会尝试lint每个文件,所以它必须是正则表达式的错误:"(\\.py$)"说实话,这对我来说很奇怪,但正是我在示例中找到的.而且"(*.py)","*.py"和"^*.py$"都是无效的正则表达式.

Bre*_*dan 20

事实证明,正则表达式实际上没有任何问题.我只是没有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.      
Run Code Online (Sandbox Code Playgroud)