]> khamidou — GitHub mirrors - arcanist.git/commit
Support PHPCS as a `.arclint` linter
authorepriestley <git@epriestley.com>
Thu, 29 Aug 2013 13:47:27 +0000 (06:47 -0700)
committerepriestley <git@epriestley.com>
Thu, 29 Aug 2013 13:47:27 +0000 (06:47 -0700)
commit2c5c9815c0c780da281a83eed7d811057781ec85
tree510ef2c39fd9f09eff086f432a4d01b6b22da63a
parent96a47759ae4c16a700e3ed121e3c80861be51a17
Support PHPCS as a `.arclint` linter

Summary:
Ref T3186. Ref T2039. Ref T3771. A few effects here:

  # Expose PHPCS as a `.arclint` linter.
  # Turn PHPCS into an ArcanistExternalLinter linter.
  # Add test coverage for PHPCS.
  # Add a `severity.rules` option to `.arclint`. Some linters have very explicit builtin severities ("error", "warning") but their meanings are different from how arc interprets these terms. For example, PHPCS raises "wrong indentation level" as an "error". You can already use the "severity" map to adjust individual rules, but if you want to adjust an entire linter it's currently difficult. This rule map makes it easy. There's substantial precedent for this in other linters, notably all the Python linters.

For `severity.rules`, for example, this will turn all PHPCS "errors" into warnings, and all of its warnings into advice:

      "severity.rules" : {
        "(^PHPCS\\.E\\.)" : "warning",
        "(^PHPCS\\.W\\.)" : "advice"
      }

The user can use `severity` (or more rules) to get additional granularity adjustments if they desire.

Test Plan: https://github.com/epriestley/arclint-examples/commit/5bb919bc3a684d6654dcc28622de9a29ec08307d

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, ajtrichards
Maniphest Tasks: T2039, T3186, T3771

Differential Revision: https://secure.phabricator.com/D6830
src/__phutil_library_map__.php
src/lint/engine/ArcanistLintEngine.php
src/lint/linter/ArcanistFilenameLinter.php
src/lint/linter/ArcanistLinter.php
src/lint/linter/ArcanistMergeConflictLinter.php
src/lint/linter/ArcanistPhpcsLinter.php
src/lint/linter/__tests__/ArcanistPHPCSLinterTestCase.php [new file with mode: 0644]
src/lint/linter/__tests__/phpcs/basics.lint-test [new file with mode: 0644]