@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use the `ArcanistConfigurationDrivenLintEngine` as a linting engine.

Summary:
Ref T2039. This diff is the equivalent to D9057, but for rP.

Depends on D9066.

Test Plan: Ran `arc lint` and ensure it doesn't complain about the `.arclint` file.

Reviewers: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T2039

Differential Revision: https://secure.phabricator.com/D9064

authored by

Joshua Spence and committed by
epriestley
566f8ab9 94772689

+65 -67
-1
.arcconfig
··· 1 1 { 2 2 "project.name" : "phabricator", 3 3 "phabricator.uri" : "https://secure.phabricator.com/", 4 - "lint.engine" : "PhabricatorLintEngine", 5 4 "unit.engine" : "PhutilUnitTestEngine", 6 5 "load" : ["src/"], 7 6 "lint.xhpast.naminghook" : "PhabricatorSymbolNameLinter",
+61
.arclint
··· 1 + { 2 + "exclude": [ 3 + "(^externals/)", 4 + "(\\.lint-test$)" 5 + ], 6 + "linters": { 7 + "filename": { 8 + "type": "filename" 9 + }, 10 + "javelin": { 11 + "type": "javelin", 12 + "include": "(\\.js$)", 13 + "exclude": [ 14 + "(^externals/JsShrink/)", 15 + "(^support/aphlict/)", 16 + "(^webroot/rsrc/externals/raphael/)" 17 + ] 18 + }, 19 + "jshint": { 20 + "type": "jshint", 21 + "include": "(\\.js$)", 22 + "exclude": [ 23 + "(^externals/JsShrink/)", 24 + "(^webroot/rsrc/externals/raphael/)" 25 + ] 26 + }, 27 + "generated": { 28 + "type": "generated" 29 + }, 30 + "merge-conflict": { 31 + "type": "merge-conflict" 32 + }, 33 + "nolint": { 34 + "type": "nolint" 35 + }, 36 + "phutil-xhpast": { 37 + "type": "phutil-xhpast", 38 + "include": "(\\.php$)", 39 + "phutil-xhpast.deprecated.functions": { 40 + "phutil_escape_html": "The phutil_escape_html() function is deprecated. Raw strings passed to phutil_tag() or hsprintf() are escaped automatically." 41 + } 42 + }, 43 + "text": { 44 + "type": "text" 45 + }, 46 + "spelling": { 47 + "type": "spelling" 48 + }, 49 + "xhpast": { 50 + "type": "xhpast", 51 + "include": "(\\.php$)", 52 + "severity": { 53 + "16": "advice", 54 + "29": "warning", 55 + "31": "error", 56 + "34": "error", 57 + "35": "error" 58 + } 59 + } 60 + } 61 + }
-66
src/infrastructure/lint/PhabricatorLintEngine.php
··· 1 - <?php 2 - 3 - /** 4 - * @concrete-extensible 5 - */ 6 - class PhabricatorLintEngine extends PhutilLintEngine { 7 - 8 - public function buildLinters() { 9 - $linters = parent::buildLinters(); 10 - 11 - foreach ($linters as $linter) { 12 - if ($linter instanceof ArcanistPhutilXHPASTLinter) { 13 - $linter->setDeprecatedFunctions(array( 14 - 'phutil_escape_html' => 15 - 'The phutil_escape_html() function is deprecated. Raw strings '. 16 - 'passed to phutil_tag() or hsprintf() are escaped automatically.', 17 - )); 18 - } 19 - } 20 - 21 - $paths = $this->getPaths(); 22 - 23 - foreach ($paths as $key => $path) { 24 - if (!$this->pathExists($path)) { 25 - unset($paths[$key]); 26 - } 27 - } 28 - 29 - $javelin_linter = new PhabricatorJavelinLinter(); 30 - $linters[] = $javelin_linter; 31 - 32 - $jshint_linter = new ArcanistJSHintLinter(); 33 - $linters[] = $jshint_linter; 34 - 35 - foreach ($paths as $path) { 36 - if (!preg_match('/\.js$/', $path)) { 37 - continue; 38 - } 39 - 40 - if (strpos($path, 'externals/JsShrink') !== false) { 41 - // Ignore warnings in JsShrink tests. 42 - continue; 43 - } 44 - 45 - if (strpos($path, 'externals/raphael') !== false) { 46 - // Ignore Raphael. 47 - continue; 48 - } 49 - 50 - $jshint_linter->addPath($path); 51 - $jshint_linter->addData($path, $this->loadData($path)); 52 - 53 - if (strpos($path, 'support/aphlict/') !== false) { 54 - // This stuff is Node.js, not Javelin, so don't apply the Javelin 55 - // linter. 56 - continue; 57 - } 58 - 59 - $javelin_linter->addPath($path); 60 - $javelin_linter->addData($path, $this->loadData($path)); 61 - } 62 - 63 - return $linters; 64 - } 65 - 66 - }
+4
src/infrastructure/lint/linter/PhabricatorJavelinLinter.php
··· 48 48 return 'JAVELIN'; 49 49 } 50 50 51 + public function getLinterConfigurationName() { 52 + return 'javelin'; 53 + } 54 + 51 55 public function getLintSeverityMap() { 52 56 return array( 53 57 self::LINT_MISSING_BINARY => ArcanistLintSeverity::SEVERITY_WARNING,