Skip to content

[CS] Update PhpCsFixer config #1190

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

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

smnandre
Copy link
Member

@smnandre smnandre commented Oct 15, 2023

I took some time to check the .php-cs-fixer.dist.php file and

  • compared it to symfony/symfony one
  • checked the rules included in the rulesets (@Symfony @Symfony:risky and @PHPUnit75Migration:risky)

Rules already in one of the rulesets:

Rules unneeded:

Rules i suggest to remove:

  • list_syntax -> not sure to see the necessity of this rule, do we need it ?
  • ordered_imports -> already in @symfony (with a different order, but the same order present in PSR and PHPCSFIXER rulesets)

--

I also realised there is no rule to include the symfony licence header in every PHP files, should we add it ? (done)


Updated config:

 ->setRules([
        '@PHPUnit75Migration:risky' => true,
        '@Symfony' => true,
        '@Symfony:risky' => true,
        'header_comment' => ['header' => $fileHeaderComment],
])

@weaverryan
Copy link
Member

I also realised there is no rule to include the symfony licence header in every PHP files, should we add it ?

Yup - that'd be great 👍

@smnandre
Copy link
Member Author

Rule added / applied

@weaverryan
Copy link
Member

list_syntax -> not sure to see the necessity of this rule, do we need it ?

No idea - we can remove it and see what happens. Reading your notes, if there are other changes you want to make, go ahead and make them and we'll see how they look.

@smnandre
Copy link
Member Author

I'm happy with this config :)

I'm gonna suggest some other CI updates now 👼

@weaverryan weaverryan force-pushed the cs/update-php-cs-fixer-config branch from 36e38cd to ddd0e8f Compare October 16, 2023 17:41
@weaverryan
Copy link
Member

Thanks Simon!

@weaverryan weaverryan merged commit 5210300 into symfony:2.x Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants