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

Don't import PSR2 ruleset by default #6

Closed
Rarst opened this issue Aug 26, 2014 · 8 comments
Closed

Don't import PSR2 ruleset by default #6

Rarst opened this issue Aug 26, 2014 · 8 comments

Comments

@Rarst
Copy link

Rarst commented Aug 26, 2014

From what I understand PSR-2 isn't really part of calisthenics principles. And some projects aren't PSR-2. And will never be because reasons. :)

With current version of CodeSniffer it's much easier to use multiple rulesets (comma separated list of them), than throw something out (need to create custom ruleset, import another ruleset, then exclude parts you don't need/want).

@guilhermeblanco
Copy link
Contributor

I have to remove it. It was part of original plan to include PSR-1, not PSR-2 as default.

@guilhermeblanco
Copy link
Contributor

Done. 9db4cf6

@Rarst
Copy link
Author

Rarst commented Aug 27, 2014

Doesn't same argument apply to PSR-1? Things like camelCase for naming aren't really part of calisthenics rules (from what I understand)?

@guilhermeblanco
Copy link
Contributor

@Rarst partially, yes.
PSR-1 should be the base line of every PHP project, and not only when really needed. I could remove it, but then I'd be forced to bring other elements to the game, such as only one class/interface/trait per file, etc.
My general sense is that if a project is not PSR-1 compliant, it's swimming against the tide.

@Rarst
Copy link
Author

Rarst commented Aug 27, 2014

My general sense is that if a project is not PSR-1 compliant, it's swimming against the tide.

Unfortunately there are rather large legacy projects around (cough WordPress cough).

only one class/interface/trait per file

This isn't actually PSR-1 requirement? As far as I remember all PSR's are fine with multiple definitions in file, it's just not common/convenient (Symfony does this in some places for example).

@guilhermeblanco
Copy link
Contributor

Unfortunately there are rather large legacy projects around (cough WordPress cough).

I know... I work on some too... =(

This isn't actually PSR-1 requirement? As far as I remember all PSR's are fine with multiple definitions in file, it's just not common/convenient (Symfony does this in some places for example).

IIRC, it was somehow demanded through the PSR-0 as it converted a class to be loaded into a file path. This almost surely enforces the 1 class 1 file rule, because from a vendor library, I could only include one class without loading the other.
I guess I should remove the PSR-1 requirement then... =(

@guilhermeblanco
Copy link
Contributor

Done as 5fd7ac0

@Rarst
Copy link
Author

Rarst commented Aug 27, 2014

Thank you for seeing it from my perspective. :)

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

No branches or pull requests

2 participants