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

Last 3.x minor | Hard deprecate all sniffs which will be removed in 4.0 #188

Open
jrfnl opened this issue Dec 25, 2023 · 3 comments
Open

Comments

@jrfnl
Copy link
Member

jrfnl commented Dec 25, 2023

It was previously already announced that the 4.0 release will drop support for:

  • JavaScript and CSS tokenizers, which also means the JS and CSS specific sniffs will be removed.
  • The MySource standard.

Additionally, the Squiz.WhiteSpace.LanguageConstructSpacing sniff was (soft) deprecated in PHPCS 3.3.0 and the Generic.Formatting.NoSpaceAfterCast sniff in PHPCS 3.4.0.

Providing #164 (PHPCS native handling of sniff deprecations) gets build and included in PHPCS ahead of 4.0, I propose to hard deprecate the sniffs affected by the above mentioned changes in the last PHPCS 3.x minor release.

Terminology used

Soft deprecation: deprecation via changelog mention and/or announcement only.
Hard deprecation: a deprecation notice will be shown at runtime, but will not affect the exit code of PHPCS.

Additional notes

  • Sniffs which support both PHP as well as JS/CSS will not be removed in PHPCS 4.0 (only the JS/CSS support will be removed), so those sniffs are not included in this proposal.

Policy

I also propose to adhere to this as a policy for PHP_CodeSniffer for the future :

  • Soft deprecate sniffs over the lifetime of a major release.
  • Hard deprecate sniffs in the last minor of that same major.

I considered always using hard deprecation, but that will be noisier than necessary and will cause additional support questions for external standards using a deprecated sniff, but supporting a range of (minor) PHP_CodeSniffer versions.

@kczx3
Copy link

kczx3 commented Dec 29, 2023

It might be worth linking to squizlabs/PHP_CodeSniffer#2448 for context. Being someone that is new to this tool, I was unaware of the previously announced removal of the tokenizers.

@jrfnl
Copy link
Member Author

jrfnl commented Dec 29, 2023

@kczx3 Thanks for adding the link. And yes, increasing awareness about these changes is exactly what this issue is about ;-)

@jrfnl
Copy link
Member Author

jrfnl commented Jan 5, 2024

Related #58: proposed removal of the Zend.Debug.CodeAnalyzer sniff in 4.0. If this PR proceeds, the sniff should be included in the sniffs to get a deprecation notice in the last 3.x minor.

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

2 participants