Skip to content

Commit 5223456

Browse files
authored
CSFixer diff-format is always udiff since 3.0 (#58)
* CSFixer diff-format is always udiff since 3.0 https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/UPGRADE-v3.md#cli-options * Update PHP-CSFixer config * Update Makefile as well
1 parent 1ed250d commit 5223456

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

.github/workflows/static-code-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Run PHP-CS-Fixer
2020
uses: docker://jakzal/phpqa:php7.3-alpine
2121
with:
22-
args: php-cs-fixer fix --dry-run --diff-format udiff -vvv
22+
args: php-cs-fixer fix --diff --dry-run -vvv
2323

2424
roave-bc-check:
2525
name: Roave BC Check

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.php-cs-fixer.cache
12
/build/
23
/composer.lock
34
/phpspec.yml

.php-cs-fixer.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude(__DIR__.'/vendor')
5+
->name('*.php')
6+
->in(__DIR__)
7+
;
8+
9+
$config = new PhpCsFixer\Config();
10+
return $config->setRules([
11+
'@Symfony' => true,
12+
'@Symfony:risky' => true,
13+
'array_syntax' => ['syntax' => 'short'],
14+
])
15+
->setRiskyAllowed(true)
16+
->setFinder($finder)
17+
;

.php_cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ DIR := ${CURDIR}
44
QA_IMAGE := jakzal/phpqa:php7.3-alpine
55

66
cs-fix:
7-
@docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) php-cs-fixer fix --diff-format udiff -vvv
7+
@docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) php-cs-fixer fix --diff -vvv
88

99
cs-diff:
10-
@docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) php-cs-fixer fix --diff-format udiff --dry-run -vvv
10+
@docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) php-cs-fixer fix --diff --dry-run -vvv
1111

1212
phpstan:
1313
@docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) phpstan analyze

0 commit comments

Comments
 (0)