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

New PSR2 + WP best practices ruleset #1067

Closed
jrfnl opened this issue Jul 26, 2017 · 6 comments
Closed

New PSR2 + WP best practices ruleset #1067

jrfnl opened this issue Jul 26, 2017 · 6 comments

Comments

@jrfnl
Copy link
Member

jrfnl commented Jul 26, 2017

A recent article by @tommcfarlin : https://tommcfarlin.com/using-psrs-in-wordpress-development/ got me thinking about PSR2 vs the WordPress Coding Standards.
I could easily create a ruleset which would allow devs to use PSR2 while still getting the benefits of the WP best practice sniffs and share it somewhere (separate repo/gist).

But what about potentially adding this as an extra ruleset here ? Not to replace any of the current rulesets, just as an alternative ruleset for non-core WordPress-related development.

Opinions ?

Related issues: #763 and #740

@dingo-d
Copy link
Member

dingo-d commented Jul 26, 2017

I don't think that it should be added as an extra ruleset since PSR standards are not allowed in core (https://core.trac.wordpress.org/ticket/23357).

For any non-standard development, users can just create their own custom rulesets, no?

@jrfnl
Copy link
Member Author

jrfnl commented Jul 26, 2017

@dingo-d Just checking: you did read that I said an alternative ruleset for non-core WordPress-related development ?

@grappler
Copy link
Member

There are two ways to go ahead.

  1. Create a new ruleset WordPress-PSR2 with WordPress best practices and PSR2 coding style
  2. Separate WordPress best practices from coding style Splitting the Core ruleset into Code style & Core #740. Then users could use WordPress-Core-Best-Practices and PSR2 without needing a new ruleset.

I think option 2 may be better. As the WordPress Community we should encourage that WordPress coding standards are used but still making it easy for people to use other coding styles.

Though I do same my files different in plugins to match a more modern PHP naming convention then what WordPress has now.

@dingo-d
Copy link
Member

dingo-d commented Jul 26, 2017

@jrfnl Yes I did read it, and I still don't see the merit for it, since users can create their own ruleset in any way they want :)

Aside from helping people, who want to include some PSR coding standards with WordPress one, out, I don't know why would this need to be added as a separate ruleset. Better add it to a wiki page, showing users how to achieve that.

That's just my opinion, didn't mean anything bad, just think that it's not that important :)

@JDGrimes
Copy link
Contributor

I think in #740 I was favorable to a WordPress-Core-Best-Practices ruleset, if we could pin down an actual use-case. As it seems that there are actual use cases, I think it may be worth splitting the Core ruleset. It shouldn't take much more work for us to maintain, but it will probably significantly ease the maintenance burden on anybody wanting a WordPress-PSR2 ruleset. I don't think that we would need to make such a ruleset ourselves, just provide the Core-Best-Practices ruleset that could be easily used in it.

@jrfnl
Copy link
Member Author

jrfnl commented Dec 2, 2022

Closing for lack of consensus.

@jrfnl jrfnl closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants