forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PSR-2 Compliance] The Great @codingStandardsIgnoreFile Massacre
- adjust php-cs-fixer configuration: add is_null and method_separation rules already enforced by phpcs sniffers, update excluded paths
- Loading branch information
Showing
1 changed file
with
19 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,29 +8,16 @@ | |
* Pre-commit hook installation: | ||
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit | ||
*/ | ||
$finder = PhpCsFixer\Finder::create() | ||
->name('*.phtml') | ||
->exclude('dev/tests/functional/generated') | ||
->exclude('dev/tests/functional/var') | ||
->exclude('dev/tests/functional/vendor') | ||
->exclude('dev/tests/integration/tmp') | ||
->exclude('dev/tests/integration/var') | ||
->exclude('lib/internal/Cm') | ||
->exclude('lib/internal/Credis') | ||
->exclude('lib/internal/Less') | ||
->exclude('lib/internal/LinLibertineFont') | ||
->exclude('pub/media') | ||
->exclude('pub/static') | ||
->exclude('setup/vendor') | ||
->exclude('var'); | ||
|
||
return PhpCsFixer\Config::create() | ||
->setFinder($finder) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'concat_space' => ['spacing' => 'one'], | ||
'include' => true, | ||
'is_null' => ['use_yoda_style' => false], | ||
This comment has been minimized.
Sorry, something went wrong. |
||
'method_separation' => true, | ||
This comment has been minimized.
Sorry, something went wrong.
orlangur
Author
Owner
|
||
'new_with_braces' => true, | ||
'no_empty_statement' => true, | ||
'no_extra_consecutive_blank_lines' => true, | ||
|
@@ -46,4 +33,19 @@ return PhpCsFixer\Config::create() | |
'ordered_imports' => true, | ||
'standardize_not_equals' => true, | ||
'ternary_operator_spaces' => true, | ||
]); | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->name('*.phtml') | ||
->exclude('dev/tests/functional/generated') | ||
->exclude('dev/tests/functional/var') | ||
->exclude('dev/tests/functional/vendor') | ||
->exclude('dev/tests/integration/tmp') | ||
->exclude('dev/tests/integration/var') | ||
->exclude('generated') | ||
->exclude('lib/internal/LinLibertineFont') | ||
->exclude('pub/media') | ||
->exclude('pub/static') | ||
->exclude('setup/vendor') | ||
->exclude('var') | ||
); |
is_null
rule is considered to be risky just because of potentialis_null
function overriding: PHP-CS-Fixer/PHP-CS-Fixer#2534 (comment)Which is not the case for Magento.