1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-24 21:48:20 +01:00
phorge-arcanist/src/lint/engine
epriestley 97ad54ed00 Lay groundwork for configuration-driven linters
Summary:
Ref T2039. That task has a bunch of discussion, but basically we do a poor job of serving the midrange of lint configuration right now.

If you have something simple, the default linters work.

If you have something complex, building your own engine lets you do whatever you want.

But many users want something in between, which isn't really well accommodated. The idea is to let you write a `.arclint` file, which looks something like this:

  {
   "linters" : {
      "css" : {
        "type" : "csslint",
        "include" : "(\.css$)",
        "exclude" : "(^externals/)",
        "bin" : "/usr/local/bin/csslint"
      },
      "js" : {
        "type" : "jshint",
        "include" : "(\.js$)",
        "exclude" : "(^externals/)",
        "bin" : "support/bin/jshint",
        "interpreter" : "/usr/local/bin/node"
      }
   }
  }

...which will provide a bunch of common options around lint severity, interpreter and binary locaitons, included and excluded files, etc.

This implements some basics, and very rough support in the Filename linter.

Test Plan:
Generated a `.arclint` file and saw it apply filename lint correctly. Used `debug` mode and tried invalid regexps.

  {
    "debug" : true,
    "linters" : {
      "filename" : {
        "type" : "filename",
        "exclude" : ["@^externals/@"]
      }
    }
  }

Next steps include:

  - Provide an external linter archetype (T3186) and expose a common set of configuration here ("bin", "interpreter", "flags", "severity").
  - Provide a `.arcunit` file which works similarly (it can probably be simpler).

Reviewers: btrahan, Firehed

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2039

Differential Revision: https://secure.phabricator.com/D6797
2013-08-22 16:02:16 -07:00
..
ArcanistConfigurationDrivenLintEngine.php Lay groundwork for configuration-driven linters 2013-08-22 16:02:16 -07:00
ArcanistLintEngine.php Support for lint messages which are always shown 2013-06-09 08:38:30 -07:00
ArcanistSingleLintEngine.php Delete license headers from files 2012-11-05 11:16:24 -08:00
ComprehensiveLintEngine.php Revert "Merge pull request #93 from vlajos/csslint" 2013-07-22 06:52:08 -07:00
ExampleLintEngine.php Delete license headers from files 2012-11-05 11:16:24 -08:00
PhutilLintEngine.php Undumb other generic text linters 2013-02-20 14:36:53 -08:00
UnitTestableArcanistLintEngine.php Delete license headers from files 2012-11-05 11:16:24 -08:00