Skip to content

Rename .php_cs to .php_cs.dist as a best practise #544

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
Apr 30, 2017
Merged

Rename .php_cs to .php_cs.dist as a best practise #544

merged 1 commit into from
Apr 30, 2017

Conversation

B-Galati
Copy link

Hello,

Everything is in the title.

I also removed the shebang because it looked useless, let me know if I am wrong :-)

@@ -1,4 +1,3 @@
#!/usr/bin/env php
Copy link
Contributor

Choose a reason for hiding this comment

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

This line helps IDEs with autocompletion since the .php_cs.dist filename doesn't have .php extension

Copy link
Author

Choose a reason for hiding this comment

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

I had this issue too with PhpStorm but I was able to force the language syntax by using "Associate with file Type" action. Any thought ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this script isn't executable - makes sense to remove this line 👍

@javiereguiluz
Copy link
Member

@B-Galati thanks for this contribution! However, I'm not entirely sure this is the right thing to do for this project. The .php_cs file defines the rules for our own code. If we create a .php_cs.dist file is like saying to our users: "hey, .php_cs.dist are our default CS rules ... but you can change them if you want in your own .php_cs file". Well, you can't change those rules. If you change them, we won't merge your PRs.

Do you agree that in this case and for this project, the .php_cs file should always be forced to all users and no customization is possible?

@bocharsky-bw
Copy link
Contributor

@javiereguiluz I agree that we should force the rules we have before merging new PRs. But I'm OK with .php_cs.dist since this way we will allow developers to play with coding standards locally without having dirty repository state. Actually, the same for phpunit.xml.dist. Why don't we force devs with phpunit.xml file? So I think it's a good idea to rename this to .php_cs.dist since it's a good practice. Anyway, I run php-cs-fixer very rare locally before pushing code and always rely on CI. And if the tests are failed, then I need to run it locally to be sure they're fixed before pushing changes the second time.

@B-Galati
Copy link
Author

@javiereguiluz I totally agree with @bocharsky-bw. As long as the CI is enforcing mandatory rules, there is no harm to allow for more flexibility to my point of view.

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

I don't like this ... but I'm going to merge it because it's coherent with the other .dist files that we use in Symfony. Thanks @B-Galati.

@javiereguiluz javiereguiluz merged commit ddbd632 into symfony:master Apr 30, 2017
javiereguiluz added a commit that referenced this pull request Apr 30, 2017
…Galati)

This PR was merged into the master branch.

Discussion
----------

Rename .php_cs to .php_cs.dist as a best practise

Hello,

Everything is in the title.

I also removed the shebang because it looked useless, let me know if I am wrong :-)

Commits
-------

ddbd632 Rename .php_cs to .php_cs.dist as a best practise
@B-Galati
Copy link
Author

B-Galati commented May 1, 2017

@javiereguiluz Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants