1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-22 21:40:54 +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:
epriestley 2014-05-11 16:16:45 -07:00
parent e13f5839d4
commit 5d1f87a8c2
12 changed files with 152 additions and 16 deletions

View file

@ -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';
}

View file

@ -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';
}

View file

@ -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';
}

View file

@ -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';
}

View file

@ -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';
}

View file

@ -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';
}

View file

@ -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';
}

View file

@ -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'),
);
}
}

View file

@ -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';
}

View file

@ -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';
}

View file

@ -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';
}

View file

@ -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 )------------------------------------------------------------ */