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

Ruleset: hard deprecate support for standards called "Internal" #893

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Mar 18, 2025

Description

Support for standards called Internal was soft deprecated in PHPCS 3.12.0

This PR adds a new Ruleset deprecation notice for when such a standard would be requested from a ruleset.

Support for sniffs not following the naming conventions will be removed in PHPCS 4.0.

Includes test.

Suggested changelog entry

Added deprecation notices (hard deprecation) for:

  • Standards called Internal, which will no longer be supported in PHPCS 4.0.

Related issues/external references

Related to #799

Support for standards called `Internal` was soft deprecated in PHPCS 3.12.0

This PR adds a new Ruleset deprecation notice for when such a standard would be requested from a ruleset.

Support for sniffs not following the naming conventions will be removed in PHPCS 4.0.

Includes test.

Related to 799
Copy link
Contributor

@rodrigoprimo rodrigoprimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I left a comment with a small suggestion.

@@ -892,6 +892,13 @@ private function expandSniffDirectory($directory, $depth=0)
*/
private function expandRulesetReference($ref, $rulesetDir, $depth=0)
{
// Naming an (external) standard "Internal" is deprecated.
if (strtolower($ref) === 'internal') {
$message = 'The name "Internal" is reserved for internal use. A PHP_CodeSniffer standard should not be called "Internal".'.PHP_EOL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to remove one use of "internal" from the message to avoid repeating it three times. I came up with the following suggestion:

Suggested change
$message = 'The name "Internal" is reserved for internal use. A PHP_CodeSniffer standard should not be called "Internal".'.PHP_EOL;
$message = 'The name "Internal" is reserved for internal use. A PHP_CodeSniffer standard should not it.'.PHP_EOL;

What do you think? This is just a nitpick. Feel free to ignore it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodrigoprimo The suggested change is a grammatical error. Want to have another look ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants