json - Phabricator linter 找不到任何 lintable 路径

标签 json regex pylint phabricator

如何将 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/

相关文章:

python - 通过python代码附加JSON文件

java - 解析复杂的 JSON 响应

ios - swift 3 : most performant way to check many strings with many regular expressions

github - 是否有可能检查导入模块的使用情况?

json - 当其中一个是来自类型函数的 'Data' 时,如何使用多个 'deduced' 实例?

php - 由未知的正则表达式分割

regex - 这个正则表达式简化是否正确?

macos - 无法安装模块 'docstring'

python - Pylint 提示 "no value for argument ' cls'”

java - 为 Spring RestTemplate POST 获取 400 错误请求