From 23487dc35768dea830b42a53d0549c3e535c2be3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 12 May 2014 06:01:30 -0700 Subject: [PATCH] Update .arclint in Phabricator for phutil-library lint Summary: Also fix a few other minor issues: - Use lint config. - Fix a method signature from `arc unit --everything` (unrelated). - Add a javelin doc. Test Plan: Ran `arc lint`, `arc unit`, `arc linters`. Reviewers: btrahan, joshuaspence Reviewed By: joshuaspence Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9072 --- .arcconfig | 4 +--- .arclint | 24 ++++++++++++++++--- src/__phutil_library_map__.php | 2 -- .../lint/linter/PhabricatorJavelinLinter.php | 11 +++++++++ .../sms/worker/PhabricatorSMSSendWorker.php | 2 +- 5 files changed, 34 insertions(+), 9 deletions(-) diff --git a/.arcconfig b/.arcconfig index 0ca12325b8..70a43b9d9a 100644 --- a/.arcconfig +++ b/.arcconfig @@ -2,7 +2,5 @@ "project.name" : "phabricator", "phabricator.uri" : "https://secure.phabricator.com/", "unit.engine" : "PhutilUnitTestEngine", - "load" : ["src/"], - "lint.xhpast.naminghook" : "PhabricatorSymbolNameLinter", - "lint.jshint.config" : "support/jshint/jshintconfig" + "load" : ["src/"] } diff --git a/.arclint b/.arclint index 809327d329..719a7ae99c 100644 --- a/.arclint +++ b/.arclint @@ -22,7 +22,8 @@ "exclude": [ "(^externals/JsShrink/)", "(^webroot/rsrc/externals/raphael/)" - ] + ], + "flags": ["--config=support/jshint/jshintconfig"] }, "generated": { "type": "generated" @@ -40,8 +41,24 @@ "phutil_escape_html": "The phutil_escape_html() function is deprecated. Raw strings passed to phutil_tag() or hsprintf() are escaped automatically." } }, + "phutil-library": { + "type": "phutil-library", + "include": "(\\.php$)" + }, "text": { - "type": "text" + "type": "text", + "exclude": [ + "(^\\.arclint)" + ] + }, + "text-without-length": { + "type": "text", + "severity": { + "3": "disabled" + }, + "include": [ + "(^\\.arclint)" + ] }, "spelling": { "type": "spelling" @@ -55,7 +72,8 @@ "31": "error", "34": "error", "35": "error" - } + }, + "xhpast.naminghook": "PhabricatorSymbolNameLinter" } } } diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index fa24e765ae..242dcd8462 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1648,7 +1648,6 @@ phutil_register_library_map(array( 'PhabricatorKeyValueDatabaseCache' => 'applications/cache/PhabricatorKeyValueDatabaseCache.php', 'PhabricatorLegalpadConfigOptions' => 'applications/legalpad/config/PhabricatorLegalpadConfigOptions.php', 'PhabricatorLegalpadPHIDTypeDocument' => 'applications/legalpad/phid/PhabricatorLegalpadPHIDTypeDocument.php', - 'PhabricatorLintEngine' => 'infrastructure/lint/PhabricatorLintEngine.php', 'PhabricatorLipsumArtist' => 'applications/lipsum/image/PhabricatorLipsumArtist.php', 'PhabricatorLipsumGenerateWorkflow' => 'applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php', 'PhabricatorLipsumManagementWorkflow' => 'applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php', @@ -4441,7 +4440,6 @@ phutil_register_library_map(array( 'PhabricatorKeyValueDatabaseCache' => 'PhutilKeyValueCache', 'PhabricatorLegalpadConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorLegalpadPHIDTypeDocument' => 'PhabricatorPHIDType', - 'PhabricatorLintEngine' => 'PhutilLintEngine', 'PhabricatorLipsumGenerateWorkflow' => 'PhabricatorLipsumManagementWorkflow', 'PhabricatorLipsumManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorLipsumMondrianArtist' => 'PhabricatorLipsumArtist', diff --git a/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php b/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php index d4d04b555e..018a156121 100644 --- a/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php +++ b/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php @@ -13,6 +13,17 @@ final class PhabricatorJavelinLinter extends ArcanistLinter { const LINT_UNKNOWN_DEPENDENCY = 4; const LINT_MISSING_BINARY = 5; + public function getInfoName() { + return 'Javelin Linter'; + } + + public function getInfoDescription() { + return pht( + 'This linter is intended for use with the Javelin JS library and '. + 'extensions. Use `javelinsymbols` to run Javelin rules on Javascript '. + 'source files.'); + } + private function getBinaryPath() { if ($this->symbolsBinary === null) { list($err, $stdout) = exec_manual('which javelinsymbols'); diff --git a/src/infrastructure/sms/worker/PhabricatorSMSSendWorker.php b/src/infrastructure/sms/worker/PhabricatorSMSSendWorker.php index 5aaed3b2c3..a630de44bc 100644 --- a/src/infrastructure/sms/worker/PhabricatorSMSSendWorker.php +++ b/src/infrastructure/sms/worker/PhabricatorSMSSendWorker.php @@ -7,7 +7,7 @@ final class PhabricatorSMSSendWorker return PhabricatorSMS::MAXIMUM_SEND_TRIES; } - public function getWaitBeforeRetry() { + public function getWaitBeforeRetry(PhabricatorWorkerTask $task) { return phutil_units('1 minute in seconds'); }