Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit 07940ea

Browse files
committed
Merge pull request #51 from JakubOnderka/VasekPurchart-git-blame-optional
Vasek purchart git blame optional
2 parents 41365ce + 73cb1a9 commit 07940ea

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

parallel-lint.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function showOptions()
2323
-j <num> Run <num> jobs in parallel (default: 10).
2424
--no-colors Disable colors in console output.
2525
--json Output results as JSON string (require PHP 5.4).
26+
--blame Try to show git blame for row with error.
2627
--git <git> Path to Git executable to show blame message (default: 'git').
2728
--stdin Load files and folder to test from standard input.
2829
-h, --help Print this help.

src/Manager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public function run(Settings $settings = null)
7979

8080
$result = $parallelLint->lint($files);
8181

82-
$this->gitBlame($result, $settings);
82+
if ($settings->blame) {
83+
$this->gitBlame($result, $settings);
84+
}
8385

8486
$output->writeResult($result, new ErrorFormatter($settings->colors, $translateTokens));
8587

src/Settings.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ class Settings
9292
*/
9393
public $stdin = false;
9494

95+
/**
96+
* Try to show git blame for row with error
97+
* @var bool
98+
*/
99+
public $blame = false;
100+
95101
/**
96102
* Path to git executable
97103
* @var string
@@ -163,6 +169,10 @@ public static function parseArguments(array $arguments)
163169
$settings->stdin = true;
164170
break;
165171

172+
case '--blame':
173+
$settings->blame = true;
174+
break;
175+
166176
default:
167177
throw new InvalidArgumentException($argument);
168178
}
20.5 KB
Loading

0 commit comments

Comments
 (0)