-
-
Notifications
You must be signed in to change notification settings - Fork 73
4.0 | Deprecate and remove support for Standards called "Internal" #799
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
Comments
This sounds quite reasonable to me. |
I'm of two minds about it. In terms of the process of deprecation, that looks fine. The part I'm not so sure about: I could see companies using "Internal" for their own... internal rulesets. This would effectively mean they would need to name them some other way. While you won't see these in public repos, the question is really how many private orgs are using that. |
@weierophinney That's a fair point and I did consider that, but it is also a situation which is currently only partially supported, so I still consider it highly unlikely that companies would be using a standard called To illustrate: <rule ref="Internal"/> ☝🏻 The above works and will load all the sniffs in the standard. <rule ref="Internal.MyCategory"/>
<rule ref="Internal.OtherCategory.SniffName"/>
<rule ref="Internal.ACategory.SniffName.ErrorCode"/> ☝🏻 None of the above will work and each of these includes will currently silently be ignored. |
FYI: PR #893 is now open to add a deprecation notice for this. |
Current Situation
The
Internal.
reference prefix is solely intended for internal use, i.e. for error codes coming from PHPCS itself about the processing of a file, such asInternal.NoCodeFound
.However, while writing tests for the
Ruleset
class, I discovered, it is currently possible to name a standardInternal
and have sniffs included from it.Aside from this being confusing for end-users, the fact that this is (incidentally ?) supported may not be taken into account in all relevant places and I wouldn't be surprised if there are bugs to content with if a standard would be called
Internal
.Proposal
Internal
in the next 3.x minor.Internal
in what is expected to be the last 3.x minor.Internal
in 4.0.0.In practice, removing support will mean that if an
Internal
standard is requested via--standard=Internal
or by including such a standard from within a ruleset via<rule ref="Internal"/>
, the standard will no longer be read out and the sniffs no longer included. The end-user will be presented with a warning letting them know the standard is being disregarded.If the
Internal
standard was the only referenced standard, the user will also be presented with a "No sniffs were registered" error.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.
Impact
It is not expected that there are any external standards in existence which are called
Internal
, so the impact is expected to be nill.Code searches of public code executed to confirm this:
Related issues
Loosely related to #689
Opinions ?
/cc @asispts @dingo-d @fredden @GaryJones @greg0ire @kukulich @michalbundyra @Ocramius @sirbrillig @stronk7 @weierophinney @wimg
The text was updated successfully, but these errors were encountered: