This repository was archived by the owner on Jul 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ function showOptions()
2525 --json Output results as JSON string (require PHP 5.4).
2626 --git <git> Path to Git executable to show blame message (default: 'git').
2727 --stdin Load files and folder to test from standard input.
28+ --blame Try to show git blame for row with error.
2829 -h, --help Print this help.
2930<?php
3031}
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments