Skip to content

Commit 01148cd

Browse files
committed
Add diff of violations on error
Example Legend: ?-unknown, I-invalid file syntax (file ignored), S-skipped (cached or empty file), .-no changes, F-fixed, E-error 1) path/tp/Command.php (declare_strict_types, blank_line_after_opening_tag, single_line_after_imports) ---------- begin diff ---------- --- Original +++ New @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace App\Console\Commands\Foo; use App\Console\Command; @@ -8,8 +10,6 @@ use RuntimeException; use Symfony\Component\Process\Process; - - class Foo extends Command { ----------- end diff -----------
1 parent f2d3047 commit 01148cd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pre-commit

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ run_php_cs_fixer() {
6262
return
6363
fi
6464

65-
# Only do a full check if the PHP Coding Standards configuration or the
66-
# Composer dependencies lock file has changed, otherwise run a check only
67-
# for the files that have changed since the last commit.
65+
# Only do a full check if the PHP Coding Standards fixer configuration file
66+
# or the Composer dependencies lock file has changed, otherwise do a check
67+
# only for files that have changed since the last commit.
6868
changed_files=$(git diff --staged --name-only --diff-filter=ACMRTUXB)
6969

7070
if ! echo "${changed_files}" | grep -qE "^(laravel/)?(\\.php-cs-fixer(\\.dist)?|composer\\.lock)$"; then
@@ -79,6 +79,7 @@ run_php_cs_fixer() {
7979

8080
"$php_cs_fixer_bin" fix --config="$php_cs_fixer_config"\
8181
-vvv \
82+
--diff \
8283
--dry-run \
8384
--stop-on-violation \
8485
--using-cache=no \

0 commit comments

Comments
 (0)