Skip to content

Commit

Permalink
fix(php-cs-fixer): separate from code-quality-pack, add new rule sets…
Browse files Browse the repository at this point in the history
…, change cache path

- require v3.11 for  `phpdoc_separation` => `groups` as it was introduced in this version (PHP-CS-Fixer/PHP-CS-Fixer@a7ed665)
- added these rule sets : `@PhpCsFixer`, `@PhpCsFixer:risky`, `@Symfony:risky`
- removed redundant rules configuration
- moved cache file to `var/cache/.php-cs-fixer.cache`
  • Loading branch information
lucasmirloup committed Jul 20, 2023
1 parent 0938b53 commit 9960c8e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 31 deletions.
4 changes: 1 addition & 3 deletions faros-ng/code-quality-pack/2.2/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"copy-from-recipe": {
".editorconfig": ".editorconfig",
".php-cs-fixer.dist.php": ".php-cs-fixer.dist.php",
"phpstan.neon.dist": "phpstan.neon.dist",
"tests/object-manager.php": "tests/object-manager.php"
},
"gitignore": [
"phpstan.neon",
".php-cs-fixer.cache"
"phpstan.neon"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
'multiline_whitespace_before_semicolons' => [
'strategy' => 'new_line_for_chained_calls',
],
'phpdoc_separation' => [
'groups' => [['ORM\\*'], ['Assert\\*']],
]
'phpdoc_separation' => true,
])
->setFinder($finder)
->setCacheFile('.php-cs-fixer.cache') // forward compatibility with 3.x line
Expand Down
18 changes: 0 additions & 18 deletions friendsofphp/php-cs-fixer/2.0/.php_cs.dist

This file was deleted.

15 changes: 8 additions & 7 deletions friendsofphp/php-cs-fixer/2.0/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"copy-from-recipe": {
".php_cs.dist": ".php_cs.dist"
},
"gitignore": [
".php_cs"
]
}
"aliases": ["cs-fixer", "php-cs-fixer"],
"copy-from-recipe": {
".php-cs-fixer.dist.php": ".php-cs-fixer.dist.php"
},
"gitignore": [
"/.php-cs-fixer.php"
]
}
23 changes: 23 additions & 0 deletions friendsofphp/php-cs-fixer/3.11/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/migrations')
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@DoctrineAnnotation' => true,
'phpdoc_separation' => [
'groups' => [['ORM\\*'], ['Assert\\*']],
],
])
->setFinder($finder)
->setCacheFile('var/cache/.php-cs-fixer.cache')
;
9 changes: 9 additions & 0 deletions friendsofphp/php-cs-fixer/3.11/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"aliases": ["cs-fixer", "php-cs-fixer"],
"copy-from-recipe": {
".php-cs-fixer.dist.php": ".php-cs-fixer.dist.php"
},
"gitignore": [
"/.php-cs-fixer.php"
]
}

0 comments on commit 9960c8e

Please sign in to comment.