Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15351808
D9038.id21516.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9038.id21516.diff
View Options
diff --git a/src/lint/linter/ArcanistConduitLinter.php b/src/lint/linter/ArcanistConduitLinter.php
--- a/src/lint/linter/ArcanistConduitLinter.php
+++ b/src/lint/linter/ArcanistConduitLinter.php
@@ -95,4 +95,8 @@
'ArcanistConduitLinter does not support a name map.'
);
}
+
+ protected function canCustomizeLintSeverities() {
+ return false;
+ }
}
diff --git a/src/lint/linter/ArcanistGeneratedLinter.php b/src/lint/linter/ArcanistGeneratedLinter.php
--- a/src/lint/linter/ArcanistGeneratedLinter.php
+++ b/src/lint/linter/ArcanistGeneratedLinter.php
@@ -28,6 +28,10 @@
return 'generated';
}
+ protected function canCustomizeLintSeverities() {
+ return false;
+ }
+
public function lintPath($path) {
$data = $this->getData($path);
if (preg_match('/@'.'generated/', $data)) {
diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php
--- a/src/lint/linter/ArcanistLinter.php
+++ b/src/lint/linter/ArcanistLinter.php
@@ -355,6 +355,10 @@
}
public function getLinterConfigurationOptions() {
+ if (!$this->canCustomizeLintSeverities()) {
+ return array();
+ }
+
return array(
'severity' => 'optional map<string|int, string>',
'severity.rules' => 'optional map<string, string>',
@@ -372,6 +376,10 @@
switch ($key) {
case 'severity':
+ if (!$this->canCustomizeLintSeverities()) {
+ break;
+ }
+
$custom = array();
foreach ($value as $code => $severity) {
if (empty($sev_map[$severity])) {
@@ -388,7 +396,12 @@
$this->setCustomSeverityMap($custom);
return;
+
case 'severity.rules':
+ if (!$this->canCustomizeLintSeverities()) {
+ break;
+ }
+
foreach ($value as $rule => $severity) {
if (@preg_match($rule, '') === false) {
throw new Exception(
@@ -412,6 +425,10 @@
throw new Exception("Incomplete implementation: {$key}!");
}
+ protected function canCustomizeLintSeverities() {
+ return true;
+ }
+
protected function shouldLintBinaryFiles() {
return false;
}
diff --git a/src/lint/linter/ArcanistNoLintLinter.php b/src/lint/linter/ArcanistNoLintLinter.php
--- a/src/lint/linter/ArcanistNoLintLinter.php
+++ b/src/lint/linter/ArcanistNoLintLinter.php
@@ -28,6 +28,10 @@
return 'nolint';
}
+ protected function canCustomizeLintSeverities() {
+ return false;
+ }
+
public function lintPath($path) {
$data = $this->getData($path);
if (preg_match('/@'.'nolint/', $data)) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 11, 3:56 PM (2 d, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7535032
Default Alt Text
D9038.id21516.diff (2 KB)
Attached To
Mode
D9038: Remove severity options from some linters.
Attached
Detach File
Event Timeline
Log In to Comment