PHPCSStandards / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
868 stars 53 forks source link

PSR-PER 2.0.0 has been released #29

Open jrfnl opened 10 months ago

jrfnl commented 10 months ago

Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/3793:

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:


@kenguest asked:

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 :-)


I replied:

@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).


@kenguest replied:

@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.


My current line of thinking on this is as follows:

jazzsequence commented 7 months ago

Semantic point but I would second @kenguest's suggestion of naming and referring to the repo and standard as PER-CS (or a variation thereof) rather than PSR-PER. PSR specifically refers to PHP Standards Recommendations whereas PER refers to PHP Evolving Recommendations; combining the two feels like mixing separate interests (even as PER is an extension of PSR-12).

kenguest commented 3 months ago

Gentle reminder, @jrfnl, that there is a migration document detailing the differences between PSR-12 and PER-CS v2 at https://github.com/php-fig/per-coding-style/blob/master/migration-2.0.md should it need to be consulted for supporting PER-CS in PHP CodeSniffer.

This link hadn't been copied over from the squizlabs/phpcs ticket that I filed over a year ago.

jrfnl commented 3 months ago

This link hadn't been copied over from the squizlabs/phpcs ticket that I filed over a year ago.

@kenguest Yes, that comment was posted in the gap between when I opened this issue and the official take-over announcement, which is why it wasn't copied over.


I'd actually been thinking off this issue not too long ago.

If it wasn't clear from the above, my preference would be for this new repo to be run by a team of ~two maintainers, with me available in the background for consultation when needed.

The "vacancy" description for these roles would be as follows:

Tasks:

Initial set up of the PER-CS repo

Continued maintenance of the PER-CS repo

Optional additional tasks (time and skills permitting)

Time investment

For the initial setup, I'd estimate approximately a week's work. For the continued maintenance, I'd estimate 1 - 2 hours a month. For the optional tasks... I don't dare to put an estimate on that.

Planning

The call for volunteers for the above is open.

If anyone is interested, but wants help getting started, I'm happy to plan a few pairing sessions via videocall to help with the initial setup.

If there are several people who are potentially interested, but not yet sure if they are up for it, I'd be open to a mob programming session to help people get more familiar with the moving parts/answer any questions/explain whatever needs explaining.

Call to action

Anyone who is interested in getting involved with this, please, please leave a comment on this ticket.

stankarp commented 1 month ago

@jrfnl Any update on this issue? Have you managed to setup a new PER-CS repo or find someone who willing to volunteer?

jrfnl commented 1 month ago

@stankarp If there had been volunteers, you would have seen their comments in this ticket (or a comment by me that people had reached out privately), so no progress so far, unfortunately.

My offer to help get this off the ground with some videocalls to get the maintainers started is still open.

rikvdh commented 1 month ago

@jrfnl I'm considering supporting this. I do not have loads of spare time, but I would love to work on this. According to your 'to do' list above, my first question would be. Is this desirable in a separate repo, or integrated into this repo?

jrfnl commented 1 month ago

@jrfnl I'm considering supporting this. I do not have loads of spare time, but I would love to work on this. According to your 'to do' list above, my first question would be. Is this desirable in a separate repo, or integrated into this repo?

That would be great!

It will be in a separate repo, but, as far as I'm concerned, the repo will be in the PHPCSStandards organisation.

The reasons for having a separate repo is quite straight-forward:

Does that answer your question ?

rikvdh commented 1 month ago

Fair enough.

PER 1.0.0 is identical to PSR-12, so this will be an "easy fix".

What is a good approach to get started? Start a repo under my own name and then migrate later to the PHPCSStandards organisation?

jrfnl commented 1 month ago

Fair enough.

PER 1.0.0 is identical to PSR-12, so this will be an "easy fix".

Correct, PER 2.0.0 is the bit which needs work (and setting up the repo and CI etc).

What is a good approach to get started? Start a repo under my own name and then migrate later to the PHPCSStandards organisation?

grin I actually already created a private repo in this organisation for it. Let me see if I can invite you to that.

Would you like to set up a call to talk things through ? If so, probably best to sort that out off-GH. You can DM me on Mastodon, X or - seeing your location - on the PHPNL Slack.

rikvdh commented 1 month ago

I'll get in touch tomorrow to schedule something. :-)

VSlokker commented 3 weeks ago

I don't have too much spare time but willing to help out on some of the work. I also don't have too much experience contributing to open source but i have to start somewhere :man_shrugging: Let me know if there is anything i can do.