PHPCSStandards / composer-installer

Composer installer for PHP_CodeSniffer coding standards
https://packagist.org/packages/dealerdirect/phpcodesniffer-composer-installer
MIT License
541 stars 36 forks source link

Proposal for limiting supported versions #221

Open jrfnl opened 2 months ago

jrfnl commented 2 months ago

At this time, the plugin is compatible with:

These are very wide ranges and is a compatibility span of more than a decade for most of these.

With this ticket, I'd like to open the discussion for limiting the range of supported versions a little.

Proposal

I would like to propose to drop support for:

Planning

I propose that these changes be made once PHP_CodeSniffer 4.0 has been released (which also drops support for PHP < 7.2).

I also propose for these changes to be released as version 1.1.0 of the plugin.

Consequences

As users of this plugin will, by definition, be using Composer, we would not be leaving users behind as Composer will handle the version negotiation and can still install the 1.0.x version if necessary.

Based on the PHP version stats available via Packagist, the PHP version drop would affect 1.5% of the users of this plugin.

While not necessarily a precise representation of the users of this plugin, based on the PHP_CodeSniffer version stats available via Packagist, the PHP_CodeSniffer version drop would affect less than 0.2% of all potential users of this plugin.

Opinions ?

fredden commented 2 months ago

This sounds like a sensible change to me. For similar reasons (and considering the stability of this package), I would also be comfortable with adjusting the minimum supported PHP to 8.2 (https://www.php.net/supported-versions), and Composer to 2.6. Users who still require a version which works on older systems can use already-released versions of this package, and Composer is well placed to resolve this automatically.

Releasing this change as a minor version makes sense given the explanations above.

jrfnl commented 2 months ago

In my opinion, upping the minimum supported PHP version to anything beyond PHP 7.2 is not up for discussion.

This plugin hooks into PHP_CodeSniffer and is used by lots of external standards for PHP_CodeSniffer.

If the minimum PHP version for this plugin would no longer be in line with the minimum PHP version supported by PHP_CodeSniffer, it would mean that all users, including external standards, would either be limited to using the 1.0.x version or would need to up their minimum supported PHP version to 8.2.

I expect that the net effect of that would be that there will be an expectation that both the 1.0.x branch as well as 1.1+ branch would continue to be maintained, especially for essential bug fixes and for fixes related to new PHP versions, and I, for one, have no intention to start maintaining two branches for this plugin.

Potherca commented 2 months ago

I am in favor of trimming the tree. I agree with these perspectives:

Users who still require a version which works on older systems can use already-released versions of this package

and

the minimum PHP version for this plugin [should] be in line with the minimum PHP version supported by PHP_CodeSniffer

Should things be documented somewhere for future reference?

jrfnl commented 2 months ago

Should things be documented somewhere for future reference?

@Potherca I'd been thinking about how to document things like that (also for PHPCS and other projects). While not an official convention, how about adding a POLICIES.md file in the .github directory ?

Alternatively, it could probably be added to the CONTRIBUTING.md file.

On that note: the CONTRIBUTING.md file currently contains info on the release process of this package. In other projects, I generally have a release-checklist.md file (example) in the .github directory containing that kind of info, as that info is only relevant for maintainers, not so much for outside contributors.

Opinions ?

Potherca commented 2 months ago

I'd say, use the same refactor pattern generally used for code. Add a bit of text and move it to a separate file when the content grows beyond comfortable bounds. Linking to separate files for more details is always good, IMHO.

Something like this?

image