Skip to content
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

Update recipe for PHP-CS-Fixer 2.19.0 and 3.0.0 #942

Merged
7 commits merged into from May 6, 2021

Conversation

OskarStark
Copy link
Contributor

Q A
License MIT
Doc issue/PR symfony/symfony-docs#...

Following https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/tag/v2.19.0

More specific:

minor #5607 DX: new config filename (keradus)

cc @keradus

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

},
"gitignore": [
"/.php-cs-fixer.php",
"/.php_cs.cache"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nor sure about that @keradus

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP CS Fixer uses:

  • .php_cs.cache for 2.x
  • .php-cs-fixer.cache for 3.x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so we need to keep .php_cs.cache for 2.x and add another recipe for 3.x with .php-cs-fixer.cache ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name is configurable though. I'd suggest to configure PHP CS Fixer to use the new cache file name so we don't need different recipes for 2.19 and 3.0.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derrabus good point for maint, but wouldnt it be best to stick with the conventions used in 3.0? thinking in terms of DX and consistency - e.g. maker-bundle will use php-cs-fixer 3.0 but does not depend on recipes. However in our test cases, we do depend on recipes and I can see the potential of the bundle vs tests being out of sync.

Another use case would be for other bundles e.g. symfonycasts || knplabs that try to stick as close as possible Symfony conventions. It would be nice to keep php-cs-fixer's configuration && .gitignore inline with Symfony w/o having to use custom naming conventions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe sth like this: https://github.com/symfony/recipes/pull/942/files#r625770976

then, 2.x and 3.x will use same name of cache file
(and that line can be removed on 3.x, as .php-cs-fixer.cache is default name on 3.x)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrushlow I don't quite get why MakerBundle would have an opinion on how PHP CS Fixer's cache file is named.

What @keradus suggested is exactly what I meant. The 2.19 release prepares the application for the transition to 3.0. If we can configure CS Fixer 2.19 to behave like 3.0, we should do that.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

@OskarStark
Copy link
Contributor Author

I added the recipe for 3.0 to this PR with the new cache file

Copy link
Member

@keradus keradus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mabye worth to mention 3.0 in PR title too

@OskarStark OskarStark changed the title Update recipe for PHP-CS-Fixer 2.19.0 Update recipe for PHP-CS-Fixer 2.19.0 and 3.0.0 May 4, 2021
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

@OskarStark
Copy link
Contributor Author

Done @keradus

weaverryan added a commit to symfony/maker-bundle that referenced this pull request May 4, 2021
This PR was squashed before being merged into the 1.0-dev branch.

Discussion
----------

[ci] upgrade php-cs-fixer 2.x -> 3.0

- [ ] depends on symfony/recipes#942
- [x] depends on #868
- [x] depends on #869

Commits
-------

2396836 [ci] upgrade php-cs-fixer 2.x -> 3.0
Co-authored-by: Dariusz Rumiński <dariusz.ruminski@gmail.com>
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

@OskarStark
Copy link
Contributor Author

Please check again

@OskarStark OskarStark requested review from stof and derrabus May 6, 2021 10:25
@ghost ghost merged commit 5764cb6 into symfony:master May 6, 2021
@OskarStark OskarStark deleted the cs-fixer-2.19 branch May 6, 2021 18:30
This pull request was closed.
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.

None yet

7 participants