-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved newlines in imports and case statements #2
Conversation
use PhpCsFixer\RuleSet\Sets\PhpCsFixerSet; | ||
|
||
$csFixerSet = new PhpCsFixerSet(); | ||
|
||
return (new PhpCsFixer\Config('standards')) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PhpCsFixer' => true, | ||
'@Symfony:risky' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at some point we have to drop the @PhpCsFixer
ruleset: it has a very large overlap with the @Symfony
ruleset, but has some different configuration for some rules. This is kind of confusing, especially when we look up the rules in https://mlocati.github.io/php-cs-fixer-configurator/
return (new PhpCsFixer\Config('standards')) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PhpCsFixer' => true, | ||
'@Symfony:risky' => true, | ||
'@PHP80Migration' => true, | ||
'@PHP80Migration:risky' => true, | ||
'@PHPUnit84Migration:risky' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe all projects are php >= 8.1 and phpunit >= 9 at this point.
static fn (string $statement): bool => $statement !== 'case', | ||
) | ||
], | ||
'blank_line_between_import_groups' => false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevents these messy imports:
class Foo
{
use const AAAA;
use const BBB;
use Acme;
use function DDD;
use AAC;
use function CCC\AA;
use Bar;
}
(literally an example of the configurator, I don't understand why they think this is a nice configuration)
Updated our config to match current settings in
pararius/office
, with the exception ofglobal_namespace_import/import_functions
since that would still trigger a very large diff in Casco, I think.