1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-24 14:30:55 +01:00

Always use lint advices

Summary:
We want to have a class of lint problems which are displayed to author and attached to revision but don't require excuse in diff workflow.
Lint advices already serve this purpose but no linters emit them because they need `--advice` flag to be processed.

By always enabling advices, we can switch more linters from warnings to advices and don't stop the diff workflow for them.

This diff also bumps down default severity of TODO rule.

Test Plan: Made lint advice mistake, ran `arc lint`.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, ide, Korvin

Differential Revision: https://secure.phabricator.com/D3364
This commit is contained in:
vrana 2012-08-22 11:07:41 -07:00
parent 29ba92c0c2
commit 129339019f
3 changed files with 2 additions and 21 deletions

View file

@ -108,7 +108,7 @@ final class ArcanistXHPASTLinter extends ArcanistLinter {
public function getLintSeverityMap() {
return array(
self::LINT_TODO_COMMENT => ArcanistLintSeverity::SEVERITY_ADVICE,
self::LINT_TODO_COMMENT => ArcanistLintSeverity::SEVERITY_DISABLED,
self::LINT_UNABLE_TO_PARSE
=> ArcanistLintSeverity::SEVERITY_WARNING,
self::LINT_NAMING_CONVENTIONS

View file

@ -141,7 +141,6 @@ EOTEXT
'less-context' => null,
'apply-patches' => '--raw disables lint.',
'never-apply-patches' => '--raw disables lint.',
'advice' => '--raw disables lint.',
'lintall' => '--raw disables lint.',
'create' => '--raw and --create both need stdin. '.
@ -161,7 +160,6 @@ EOTEXT
'less-context' => null,
'apply-patches' => '--raw-command disables lint.',
'never-apply-patches' => '--raw-command disables lint.',
'advice' => '--raw-command disables lint.',
'lintall' => '--raw-command disables lint.',
),
),
@ -187,7 +185,6 @@ EOTEXT
"Do not run lint.",
'conflicts' => array(
'lintall' => '--nolint suppresses lint.',
'advice' => '--nolint suppresses lint.',
'apply-patches' => '--nolint suppresses lint.',
'never-apply-patches' => '--nolint suppresses lint.',
),
@ -201,7 +198,6 @@ EOTEXT
'message' => '--only does not affect revisions.',
'edit' => '--only does not affect revisions.',
'lintall' => '--only suppresses lint.',
'advice' => '--only suppresses lint.',
'apply-patches' => '--only suppresses lint.',
'never-apply-patches' => '--only suppresses lint.',
),
@ -246,13 +242,6 @@ EOTEXT
'lint' => true,
),
),
'advice' => array(
'help' =>
"Raise lint advice in addition to lint warnings and errors.",
'passthru' => array(
'lint' => true,
),
),
'apply-patches' => array(
'help' =>
'Apply patches suggested by lint to the working copy without '.

View file

@ -92,10 +92,6 @@ EOTEXT
"With 'json', show lint warnings in machine-readable JSON format. ".
"With 'compiler', show lint warnings in suitable for your editor."
),
'advice' => array(
'help' =>
"Show lint advice, not just warnings and errors."
),
'engine' => array(
'param' => 'classname',
'help' =>
@ -179,11 +175,7 @@ EOTEXT
$this->engine = $engine;
$engine->setWorkingCopy($working_copy);
if ($this->getArgument('advice')) {
$engine->setMinimumSeverity(ArcanistLintSeverity::SEVERITY_ADVICE);
} else {
$engine->setMinimumSeverity(ArcanistLintSeverity::SEVERITY_AUTOFIX);
}
// Propagate information about which lines changed to the lint engine.
// This is used so that the lint engine can drop warning messages