Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15385579
D10005.id28145.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D10005.id28145.diff
View Options
diff --git a/src/lint/linter/ArcanistCSSLintLinter.php b/src/lint/linter/ArcanistCSSLintLinter.php
--- a/src/lint/linter/ArcanistCSSLintLinter.php
+++ b/src/lint/linter/ArcanistCSSLintLinter.php
@@ -33,12 +33,8 @@
);
}
- protected function getDefaultFlags() {
- return $this->getDeprecatedConfiguration('lint.csslint.options', array());
- }
-
public function getDefaultBinary() {
- return $this->getDeprecatedConfiguration('lint.csslint.bin', 'csslint');
+ return 'csslint';
}
public function getVersion() {
diff --git a/src/lint/linter/ArcanistCppcheckLinter.php b/src/lint/linter/ArcanistCppcheckLinter.php
--- a/src/lint/linter/ArcanistCppcheckLinter.php
+++ b/src/lint/linter/ArcanistCppcheckLinter.php
@@ -26,14 +26,7 @@
}
public function getDefaultBinary() {
- $prefix = $this->getDeprecatedConfiguration('lint.cppcheck.prefix');
- $bin = $this->getDeprecatedConfiguration('lint.cppcheck.bin', 'cppcheck');
-
- if ($prefix) {
- return $prefix.'/'.$bin;
- } else {
- return $bin;
- }
+ return 'cppcheck';
}
public function getVersion() {
@@ -61,12 +54,6 @@
);
}
- protected function getDefaultFlags() {
- return $this->getDeprecatedConfiguration(
- 'lint.cppcheck.options',
- array('-j2', '--enable=performance,style,portability,information'));
- }
-
public function shouldExpectCommandErrors() {
return false;
}
diff --git a/src/lint/linter/ArcanistCpplintLinter.php b/src/lint/linter/ArcanistCpplintLinter.php
--- a/src/lint/linter/ArcanistCpplintLinter.php
+++ b/src/lint/linter/ArcanistCpplintLinter.php
@@ -14,14 +14,7 @@
}
public function getDefaultBinary() {
- $prefix = $this->getDeprecatedConfiguration('lint.cpplint.prefix');
- $bin = $this->getDeprecatedConfiguration('lint.cpplint.bin', 'cpplint.py');
-
- if ($prefix) {
- return $prefix.'/'.$bin;
- } else {
- return $bin;
- }
+ return 'cpplint';
}
public function getInstallInstructions() {
@@ -37,10 +30,6 @@
return '-';
}
- protected function getDefaultFlags() {
- return $this->getDeprecatedConfiguration('lint.cpplint.options', array());
- }
-
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$lines = explode("\n", $stderr);
diff --git a/src/lint/linter/ArcanistFlake8Linter.php b/src/lint/linter/ArcanistFlake8Linter.php
--- a/src/lint/linter/ArcanistFlake8Linter.php
+++ b/src/lint/linter/ArcanistFlake8Linter.php
@@ -28,19 +28,8 @@
return 'flake8';
}
- protected function getDefaultFlags() {
- return $this->getDeprecatedConfiguration('lint.flake8.options', array());
- }
-
public function getDefaultBinary() {
- $prefix = $this->getDeprecatedConfiguration('lint.flake8.prefix');
- $bin = $this->getDeprecatedConfiguration('lint.flake8.bin', 'flake8');
-
- if ($prefix) {
- return $prefix.'/'.$bin;
- } else {
- return $bin;
- }
+ return 'flake8';
}
public function getVersion() {
diff --git a/src/lint/linter/ArcanistJSHintLinter.php b/src/lint/linter/ArcanistJSHintLinter.php
--- a/src/lint/linter/ArcanistJSHintLinter.php
+++ b/src/lint/linter/ArcanistJSHintLinter.php
@@ -44,14 +44,7 @@
}
public function getDefaultBinary() {
- $prefix = $this->getDeprecatedConfiguration('lint.jshint.prefix');
- $bin = $this->getDeprecatedConfiguration('lint.jshint.bin', 'jshint');
-
- if ($prefix) {
- return $prefix.'/'.$bin;
- } else {
- return $bin;
- }
+ return 'jshint';
}
public function getVersion() {
@@ -126,19 +119,6 @@
return parent::setLinterConfigurationValue($key, $value);
}
- protected function getDefaultFlags() {
- $options = $this->getDeprecatedConfiguration(
- 'lint.jshint.options',
- array());
-
- $config = $this->getDeprecatedConfiguration('lint.jshint.config');
- if ($config) {
- $options[] = '--config='.$config;
- }
-
- return $options;
- }
-
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$errors = json_decode($stdout, true);
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
@@ -459,47 +459,4 @@
return $code;
}
- /**
- * Retrieve an old lint configuration value from `.arcconfig` or a similar
- * source.
- *
- * Modern linters should use @{method:getConfig} to read configuration from
- * `.arclint`.
- *
- * @param string Configuration key to retrieve.
- * @param wild Default value to return if key is not present in config.
- * @return wild Configured value, or default if no configuration exists.
- */
- final protected function getDeprecatedConfiguration($key, $default = null) {
- // If we're being called in a context without an engine (probably from
- // `arc linters`), just return the default value.
- if (!$this->engine) {
- return $default;
- }
-
- $config = $this->getEngine()->getConfigurationManager();
-
- // Construct a sentinel object so we can tell if we're reading config
- // or not.
- $sentinel = (object)array();
- $result = $config->getConfigFromAnySource($key, $sentinel);
-
- // If we read config, warn the user that this mechanism is deprecated and
- // discouraged.
- if ($result !== $sentinel) {
- $console = PhutilConsole::getConsole();
- $console->writeErr(
- "**%s**: %s\n",
- pht('Deprecation Warning'),
- pht(
- 'Configuration option "%s" is deprecated. Generally, linters should '.
- 'now be configured using an `.arclint` file. See "Arcanist User '.
- 'Guide: Lint" in the documentation for more information.',
- $key));
- return $result;
- }
-
- return $default;
- }
-
}
diff --git a/src/lint/linter/ArcanistPEP8Linter.php b/src/lint/linter/ArcanistPEP8Linter.php
--- a/src/lint/linter/ArcanistPEP8Linter.php
+++ b/src/lint/linter/ArcanistPEP8Linter.php
@@ -27,10 +27,6 @@
return 'pep8';
}
- protected function getDefaultFlags() {
- return $this->getDeprecatedConfiguration('lint.pep8.options', array());
- }
-
public function shouldUseInterpreter() {
return ($this->getDefaultBinary() !== 'pep8');
}
@@ -44,13 +40,6 @@
return 'pep8';
}
- $old_prefix = $this->getDeprecatedConfiguration('lint.pep8.prefix');
- $old_bin = $this->getDeprecatedConfiguration('lint.pep8.bin');
- if ($old_prefix || $old_bin) {
- $old_bin = nonempty($old_bin, 'pep8');
- return $old_prefix.'/'.$old_bin;
- }
-
$arc_root = dirname(phutil_get_library_root('arcanist'));
return $arc_root.'/externals/pep8/pep8.py';
}
diff --git a/src/lint/linter/ArcanistPhpcsLinter.php b/src/lint/linter/ArcanistPhpcsLinter.php
--- a/src/lint/linter/ArcanistPhpcsLinter.php
+++ b/src/lint/linter/ArcanistPhpcsLinter.php
@@ -65,23 +65,8 @@
return $options;
}
- protected function getDefaultFlags() {
- $options = $this->getDeprecatedConfiguration('lint.phpcs.options', array());
- $standard = $this->getDeprecatedConfiguration('lint.phpcs.standard');
-
- if (!empty($standard)) {
- if (is_array($options)) {
- $options[] = '--standard='.$standard;
- } else {
- $options .= ' --standard='.$standard;
- }
- }
-
- return $options;
- }
-
public function getDefaultBinary() {
- return $this->getDeprecatedConfiguration('lint.phpcs.bin', 'phpcs');
+ return 'phpcs';
}
public function getVersion() {
diff --git a/src/lint/linter/ArcanistPyFlakesLinter.php b/src/lint/linter/ArcanistPyFlakesLinter.php
--- a/src/lint/linter/ArcanistPyFlakesLinter.php
+++ b/src/lint/linter/ArcanistPyFlakesLinter.php
@@ -28,14 +28,7 @@
}
public function getDefaultBinary() {
- $prefix = $this->getDeprecatedConfiguration('lint.pyflakes.prefix');
- $bin = $this->getDeprecatedConfiguration('lint.pyflakes.bin', 'pyflakes');
-
- if ($prefix) {
- return $prefix.'/'.$bin;
- } else {
- return $bin;
- }
+ return 'pyflakes';
}
public function getVersion() {
diff --git a/src/lint/linter/ArcanistRubyLinter.php b/src/lint/linter/ArcanistRubyLinter.php
--- a/src/lint/linter/ArcanistRubyLinter.php
+++ b/src/lint/linter/ArcanistRubyLinter.php
@@ -26,11 +26,6 @@
}
public function getDefaultBinary() {
- $prefix = $this->getDeprecatedConfiguration('lint.ruby.prefix');
- if ($prefix !== null) {
- $ruby_bin = $prefix.'ruby';
- }
-
return 'ruby';
}
diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php
--- a/src/lint/linter/ArcanistXHPASTLinter.php
+++ b/src/lint/linter/ArcanistXHPASTLinter.php
@@ -784,9 +784,7 @@
$hook_obj = null;
$working_copy = $this->getEngine()->getWorkingCopy();
if ($working_copy) {
- $hook_class = $this->switchhook
- ? $this->switchhook
- : $this->getDeprecatedConfiguration('lint.xhpast.switchhook');
+ $hook_class = $this->switchhook;
if ($hook_class) {
$hook_obj = newv($hook_class, array());
assert_instances_of(array($hook_obj), 'ArcanistXHPASTLintSwitchHook');
diff --git a/src/lint/linter/__tests__/cppcheck/file1.lint-test b/src/lint/linter/__tests__/cppcheck/file1.lint-test
--- a/src/lint/linter/__tests__/cppcheck/file1.lint-test
+++ b/src/lint/linter/__tests__/cppcheck/file1.lint-test
@@ -6,4 +6,3 @@
}
~~~~~~~~~~
error:4:
-warning:4:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 10:53 PM (3 d, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704303
Default Alt Text
D10005.id28145.diff (9 KB)
Attached To
Mode
D10005: Remove deprecated linter configuration
Attached
Detach File
Event Timeline
Log In to Comment