Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phabricator linter can't find any lintable paths

How can I configure phabricator to lint only files that match *py?

The following is my .arclint file:

{
  "linters": {
    "pylint": {
      "type": "pylint",
      "include": "(\\.py$)"
    }
  }
}

which is based heavily on the examples found here: https://secure.phabricator.com/book/phabricator/article/arcanist_lint/

When I run it I get this:

$ arc lint 
No paths are lintable.

If I remove the include line it tries to lint every file, so it must be something wrong with the regular expression: "(\\.py$)" which to be honest looks weird to me but is exactly what I found in the examples. And "(*.py)", "*.py", and "^*.py$" are all invalid regular expressions.

like image 251
Brendan W Avatar asked Nov 05 '15 19:11

Brendan W


1 Answers

So it turns out there's actually nothing wrong with the regular expression. I'm just not using arc lint correctly.

The arc lint command only tries to lint files that have been modified. I was just expecting it to behave like 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.      
like image 192
Brendan W Avatar answered Sep 19 '22 05:09

Brendan W