From b63828a87eb27e0b8cc18e6f17106262ce0578b2 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Sun, 11 May 2014 19:33:40 -0700 Subject: [PATCH] Use the `ArcanistConfigurationDrivenLintEngine` as a linting engine. Summary: Ref T2039. The `.arclint` file is reasonably complete now and we should start using it if possible, since we are trying to recommend it to others. Test Plan: `arc lint`. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T2039 Differential Revision: https://secure.phabricator.com/D9057 --- .arcconfig | 1 - .arclint | 41 +++++++++++++++++++ .../linter/ArcanistPhutilXHPASTLinter.php | 4 ++ src/lint/linter/ArcanistXHPASTLinter.php | 4 ++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .arclint diff --git a/.arcconfig b/.arcconfig index fac4c79c..a6623f44 100644 --- a/.arcconfig +++ b/.arcconfig @@ -1,7 +1,6 @@ { "project.name" : "arcanist", "phabricator.uri" : "https://secure.phabricator.com/", - "lint.engine" : "PhutilLintEngine", "unit.engine" : "PhutilUnitTestEngine", "load" : [ "src/" diff --git a/.arclint b/.arclint new file mode 100644 index 00000000..12bc5504 --- /dev/null +++ b/.arclint @@ -0,0 +1,41 @@ +{ + "exclude": [ + "(^externals/)", + "(\\.lint-test$)" + ], + "linters": { + "filename": { + "type": "filename" + }, + "generated": { + "type": "generated" + }, + "merge-conflict": { + "type": "merge-conflict" + }, + "nolint": { + "type": "nolint" + }, + "phutil-xhpast": { + "type": "phutil-xhpast", + "include": "(\\.php$)" + }, + "text": { + "type": "text" + }, + "spelling": { + "type": "spelling" + }, + "xhpast": { + "type": "xhpast", + "include": "(\\.php$)", + "severity": { + "16": "advice", + "29": "warning", + "31": "error", + "34": "error", + "35": "error" + } + } + } +} diff --git a/src/lint/linter/ArcanistPhutilXHPASTLinter.php b/src/lint/linter/ArcanistPhutilXHPASTLinter.php index b5a59d59..e58a1b9c 100644 --- a/src/lint/linter/ArcanistPhutilXHPASTLinter.php +++ b/src/lint/linter/ArcanistPhutilXHPASTLinter.php @@ -46,6 +46,10 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter { return 'PHLXHP'; } + public function getLinterConfigurationName() { + return 'phutil-xhpast'; + } + public function getCacheVersion() { $version = '2'; $path = xhpast_get_binary_path(); diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index dc288412..e74cb71d 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -91,6 +91,10 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter { return 'XHP'; } + public function getLinterConfigurationName() { + return 'xhpast'; + } + public function getLintSeverityMap() { $disabled = ArcanistLintSeverity::SEVERITY_DISABLED; $advice = ArcanistLintSeverity::SEVERITY_ADVICE; -- 2.43.0