squizlabs/PHP_CodeSniffer

PSR-PER 2.0.0 has been released

jrfnl opened this issue · 8 comments

jrfnl commented

PSR-PER is an evolving standard which builds onto PSR-12.

The first "release" (= updated standards publication) since the fork of PSR-12 has just been published.

I'm opening this ticket to allow for a discussion on if and if so, how to handle these evolving standards in PHPCS.

Refs:

Are there any plans on implementing this?

jrfnl commented

@viktorprogger Still up for discussion, but I'd deem it likely (once we've worked through most of the backlog).

Is there anything that can be done to help nudge this along?

Also, can I just note that the PER for Coding Standards shouldn't be referred to as a PSR - it is PER CS 2.0 :-)

jrfnl commented

@kenguest Well, aside from the decision which still needs to be taken about this, it might be good to create an action list of the differences between PSR-12 and PSR-PER ?

For each difference, it will need to be determined whether there is an existing sniff which could handle this (possibly with a public property setting) or whether a new sniff is needed.

Another thing to have a good think about would be how to handle versioning, as without some form of versioning, a PSR-PER ruleset would be a moving target which could randomly start failing CI builds due to new rules being introduced (and being sniffed for).

@jrfnl I'm working on a list of changes between the two standards, then an action list.
PER-CS is at version 2 at the moment, and there will be distinct version numbers so it should just be a case of having one set of sniffs called PERCS200 (for v2.0.0) and so on.

As far as I've seen, PER 2.0 only adds some rules on top of PSR-12 for the new language features.

Here the differences can be better appreciated:
https://github.com/php-fig/per-coding-style/compare/8201676d799ca5d03bec8ee702df1dd3fda8d2b0..2.0.0

@jrfnl We've (php fig) got a migration document now, it's at https://github.com/php-fig/per-coding-style/blob/master/migration-2.0.md

jrfnl commented

Closing as replaced by PHPCSStandards/PHP_CodeSniffer#29