-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature suggestion: allow for "standards" to be hidden #2760
Comments
Sounds like a pretty specialised feature, but not a bad one. |
Thinking about this issue now, I have a feeling end-users might get confused if they don't see an expected standard when running Possibly listing them as a separate category "Additional non-standard rulesets" or something like that ? (including I'd love to see more input from end-users about what would be most helpful to them. |
Closing as replaced by PHPCSStandards/PHP_CodeSniffer#18 |
Use-case: sniffs in generic sniff collections - like the
Generic
set in PHPCS - can be freely used by other standards, but shouldn't ever be included in a custom ruleset like<rule ref="Generic"/>
as they may (and often will, likeGeneric
) contain sniffs which contradict each other.For the build-in
Generic
standard, PHPCS makes a hard-coded exception and doesn't list it when someone calls upphpcs -i
.PHP_CodeSniffer/src/Util/Standards.php
Lines 107 to 110 in 120c713
PHP_CodeSniffer/src/Util/Standards.php
Lines 197 to 200 in 120c713
I'd like to propose making that a feature available to external standards as well.
For one, I imagine the
SlevomatCodingStandard
could use it, but I see some more use-cases in the future.I envision this can most easily be done by adding a new attribute to the
ruleset
element in thexsd
and adjusting the code for the-i
option to respect the setting found there.Something like
list
with the default beingtrue
.Implementation-wise, AFAICS this will be easiest to implement via the
Standards::getInstalledStandardDetails()
method and theStandards::getInstalledStandards()
should then probably defer to that method instead of it being a stand-alone method.Opinions ?
The text was updated successfully, but these errors were encountered: