Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15425259
D18644.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D18644.diff
View Options
diff --git a/src/workflow/ArcanistLintWorkflow.php b/src/workflow/ArcanistLintWorkflow.php
--- a/src/workflow/ArcanistLintWorkflow.php
+++ b/src/workflow/ArcanistLintWorkflow.php
@@ -13,7 +13,6 @@
const DEFAULT_SEVERITY = ArcanistLintSeverity::SEVERITY_ADVICE;
private $unresolvedMessages;
- private $shouldLintAll;
private $shouldAmendChanges = false;
private $shouldAmendWithoutPrompt = false;
private $shouldAmendAutofixesWithoutPrompt = false;
@@ -61,17 +60,6 @@
'help' => pht(
'Show all lint warnings, not just those on changed lines. When '.
'paths are specified, this is the default behavior.'),
- 'conflicts' => array(
- 'only-changed' => true,
- ),
- ),
- 'only-changed' => array(
- 'help' => pht(
- 'Show lint warnings just on changed lines. When no paths are '.
- 'specified, this is the default.'),
- 'conflicts' => array(
- 'lintall' => true,
- ),
),
'rev' => array(
'param' => 'revision',
@@ -177,25 +165,34 @@
'--everything'));
}
- if ($rev && $paths) {
- throw new ArcanistUsageException(
- pht('Specify either %s or paths.', '--rev'));
+ if ($rev !== null) {
+ $this->parseBaseCommitArgument(array($rev));
}
+ // Sometimes, we hide low-severity messages which occur on lines which
+ // were not changed. This is the default behavior when you run "arc lint"
+ // with no arguments: if you touched a file, but there was already some
+ // minor warning about whitespace or spelling elsewhere in the file, you
+ // don't need to correct it.
- // NOTE: When the user specifies paths, we imply --lintall and show all
- // warnings for the paths in question. This is easier to deal with for
- // us and less confusing for users.
- $this->shouldLintAll = $paths ? true : false;
+ // In other modes, notably "arc lint <file>", this is not the defualt
+ // behavior. If you ask us to lint a specific file, we show you all the
+ // lint messages in the file.
+
+ // You can change this behavior with various flags, including "--lintall",
+ // "--rev", and "--everything".
if ($this->getArgument('lintall')) {
- $this->shouldLintAll = true;
- } else if ($this->getArgument('only-changed')) {
- $this->shouldLintAll = false;
+ $lint_all = true;
+ } else if ($rev !== null) {
+ $lint_all = false;
+ } else if ($paths || $everything) {
+ $lint_all = true;
+ } else {
+ $lint_all = false;
}
if ($everything) {
$paths = iterator_to_array($this->getRepositoryAPI()->getAllFiles());
- $this->shouldLintAll = true;
} else {
$paths = $this->selectPathsForWorkflow($paths, $rev);
}
@@ -209,7 +206,7 @@
// This is used so that the lint engine can drop warning messages
// concerning lines that weren't in the change.
$engine->setPaths($paths);
- if (!$this->shouldLintAll) {
+ if ($lint_all) {
foreach ($paths as $path) {
// Note that getChangedLines() returns null to indicate that a file
// is binary or a directory (i.e., changed lines are not relevant).
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 24, 3:38 AM (21 h, 45 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7719483
Default Alt Text
D18644.diff (3 KB)
Attached To
Mode
D18644: Remove "arc lint --only-changed"
Attached
Detach File
Event Timeline
Log In to Comment