mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
Provide more help text for arc linters
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
This commit is contained in:
parent
e13f5839d4
commit
5d1f87a8c2
12 changed files with 152 additions and 16 deletions
|
@ -5,6 +5,19 @@
|
|||
*/
|
||||
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';
|
||||
}
|
||||
|
|
|
@ -2,13 +2,21 @@
|
|||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
|
|
|
@ -3,11 +3,23 @@
|
|||
/**
|
||||
* 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';
|
||||
}
|
||||
|
|
|
@ -2,11 +2,20 @@
|
|||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
|
|
|
@ -2,11 +2,22 @@
|
|||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
|
|
|
@ -4,6 +4,19 @@
|
|||
* 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';
|
||||
}
|
||||
|
|
|
@ -16,6 +16,20 @@ final class ArcanistLesscLinter extends ArcanistExternalLinter {
|
|||
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';
|
||||
}
|
||||
|
|
|
@ -2,12 +2,21 @@
|
|||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
|
@ -31,7 +40,7 @@ final class ArcanistMergeConflictLinter extends ArcanistLinter {
|
|||
$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.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +53,7 @@ final class ArcanistMergeConflictLinter extends ArcanistLinter {
|
|||
|
||||
public function getLintNameMap() {
|
||||
return array(
|
||||
self::LINT_MERGECONFLICT => 'Unresolved merge conflict',
|
||||
self::LINT_MERGECONFLICT => pht('Unresolved merge conflict'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,20 @@
|
|||
*/
|
||||
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';
|
||||
}
|
||||
|
|
|
@ -2,11 +2,23 @@
|
|||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
|
|
|
@ -2,11 +2,21 @@
|
|||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
|
|
|
@ -160,6 +160,17 @@ final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
|
|||
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 )------------------------------------------------------------ */
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue