-
Notifications
You must be signed in to change notification settings - Fork 5
Add coding style to contributing guide #2
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,18 @@ This repository follows the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) | |
you must follow these rules. | ||
|
||
|
||
## Coding style | ||
|
||
Apart from the standards above, we have a few more rules which we think makes programming more logical: | ||
|
||
1. Don't align key value pairs: it messes up diff (this applies to code, config, even docblocks) | ||
2. Use trailing commas after last array elements | ||
|
||
See these articles for reference: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the reference is only one article... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I had more ideas in my mind with more reference, but I couldn't recall. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we only specify PSR2 for the moment and remove these rules ? (To be in appliance with the .php_cs file) After that everyone can do a pull request with a change to the .php_cs file and the documentation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I want to close this PR without merging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be worth to have the deciding worklfow for new rules in the documentation WDYT ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think so. I don't expect too much contribution from the community on this front. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good for me then. |
||
|
||
- http://mnapoli.fr/approaching-coding-style-rationally/ | ||
|
||
|
||
## Semver | ||
|
||
We are trying to follow [semver](http://semver.org/). When you are making BC breaking changes, | ||
|
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 would make this a sub-title of "Coding Standards" and call it "Additional Coding Style"
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.
Good idea 👍