Summary: Ref T2039. This isn't exhaustive, but moves things forward by a decent chunk.
Test Plan: Used `arc linters` and read the messages.
Reviewers: chad, btrahan, joshuaspence
Reviewed By: joshuaspence
Subscribers: epriestley
Maniphest Tasks: T2039
Differential Revision: https://secure.phabricator.com/D9056
*/
final class ArcanistCSSLintLinter extends ArcanistExternalLinter {
+ public function getInfoName() {
+ return 'CSSLint';
+ }
+
+ public function getInfoURI() {
+ return 'http://csslint.net';
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Use `csslint` to detect issues with CSS source files.');
+ }
+
public function getLinterName() {
return 'CSSLint';
}
/**
* Stifles creativity in choosing imaginative file names.
- *
- * @group linter
*/
final class ArcanistFilenameLinter extends ArcanistLinter {
const LINT_BAD_FILENAME = 1;
+ public function getInfoName() {
+ return pht('Filename');
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Stifles developer creativity by requiring files have uninspired names '.
+ 'containing only letters, numbers, period, hyphen and underscore.');
+ }
+
public function getLinterName() {
return 'NAME';
}
/**
* Uses "flake8" to detect various errors in Python code.
* Requires version 1.7.0 or newer of flake8.
- *
- * @group linter
*/
final class ArcanistFlake8Linter extends ArcanistExternalLinter {
+ public function getInfoName() {
+ return 'Flake8';
+ }
+
+ public function getInfoURI() {
+ return 'https://pypi.python.org/pypi/flake8';
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Uses `flake8` to run several linters (PyFlakes, pep8, and a McCabe '.
+ 'complexity checker) on Python source files.');
+ }
+
public function getLinterName() {
return 'flake8';
}
/**
* Stops other linters from running on generated code.
- *
- * @group linter
*/
final class ArcanistGeneratedLinter extends ArcanistLinter {
+ public function getInfoName() {
+ return pht('Generated Code');
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Disables lint for files that are marked as "%s", indicating that they '.
+ 'contain generated code.',
+ '@'.'generated');
+ }
+
public function getLinterName() {
return 'GEN';
}
/**
* Uses JSHint to detect errors and potential problems in JavaScript code.
- *
- * @group linter
*/
final class ArcanistJSHintLinter extends ArcanistExternalLinter {
+ public function getInfoName() {
+ return 'JSHint';
+ }
+
+ public function getInfoURI() {
+ return 'http://www.jshint.com';
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Use `jshint` to detect issues with Javascript source files.');
+ }
+
public function getLinterName() {
return 'JSHint';
}
* A linter for JSON files.
*/
final class ArcanistJSONLintLinter extends ArcanistExternalLinter {
+
+ public function getInfoName() {
+ return 'JSON Lint';
+ }
+
+ public function getInfoURI() {
+ return 'https://github.com/zaach/jsonlint';
+ }
+
+ public function getInfoDescription() {
+ return pht('Use `jsonlint` to detect syntax errors in JSON files.');
+ }
+
public function getLinterName() {
return 'JSON';
}
const LINT_PARSE_ERROR = 6;
const LINT_SYNTAX_ERROR = 7;
+ public function getInfoName() {
+ return pht('Less');
+ }
+
+ public function getInfoURI() {
+ return 'https://lesscss.org/';
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Use the `--lint` mode provided by `lessc` to detect errors in Less '.
+ 'source files.');
+ }
+
public function getLinterName() {
return 'LESSC';
}
/**
* Checks files for unresolved merge conflicts.
- *
- * @group linter
*/
final class ArcanistMergeConflictLinter extends ArcanistLinter {
+
const LINT_MERGECONFLICT = 1;
+ public function getInfoName() {
+ return pht('Merge Conflicts');
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Raises errors on unresolved merge conflicts in source files, to catch '.
+ 'mistakes where a conflicted file is accidentally marked as resolved.');
+ }
+
public function getLinterName() {
return 'MERGECONFLICT';
}
$lineno + 1,
0,
self::LINT_MERGECONFLICT,
- 'This syntax indicates there is an unresolved merge conflict.');
+ pht('This syntax indicates there is an unresolved merge conflict.'));
}
}
}
public function getLintNameMap() {
return array(
- self::LINT_MERGECONFLICT => 'Unresolved merge conflict',
+ self::LINT_MERGECONFLICT => pht('Unresolved merge conflict'),
);
}
}
*/
final class ArcanistPuppetLintLinter extends ArcanistExternalLinter {
+ public function getInfoURI() {
+ return 'http://puppet-lint.com/';
+ }
+
+ public function getInfoName() {
+ return pht('puppet-lint');
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Use `puppet-lint` to check that your Puppet manifests conform to '.
+ 'the style guide.');
+ }
+
public function getLinterName() {
return 'PUPPETLINT';
}
/**
* Uses "PyFlakes" to detect various errors in Python code.
- *
- * @group linter
*/
final class ArcanistPyFlakesLinter extends ArcanistExternalLinter {
+ public function getInfoURI() {
+ return 'https://pypi.python.org/pypi/pyflakes';
+ }
+
+ public function getInfoName() {
+ return pht('PyFlakes');
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'PyFlakes is a simple program which checks Python source files for '.
+ 'errors.');
+ }
+
public function getLinterName() {
return 'PYFLAKES';
}
/**
* Uses `ruby` to detect various errors in Ruby code.
- *
- * @group linter
*/
final class ArcanistRubyLinter extends ArcanistExternalLinter {
+ public function getInfoURI() {
+ return 'https://www.ruby-lang.org/';
+ }
+
+ public function getInfoName() {
+ return pht('Ruby');
+ }
+
+ public function getInfoDescription() {
+ return pht('Use `ruby` to check for syntax errors in Ruby source files.');
+ }
+
public function getLinterName() {
return 'RUBY';
}
private $output = array();
+ public function getInfoName() {
+ return pht('Script and Regex');
+ }
+
+ public function getInfoDescription() {
+ return pht(
+ 'Run an external script, then parse its output with a regular '.
+ 'expression. This is a generic binding that can be used to '.
+ 'run custom lint scripts.');
+ }
+
/* -( Linting )------------------------------------------------------------ */