-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Add ruleset XML files to categorize and subset sniffs #58
Comments
I am not entirely sure how to test it in my setup. I am using CS via PhpStorm and currently can only point it to folder, not to specific XML file. |
@Rarst Strange that PhpStorm doesn't allow you to specify arguments for #!/bin/bash
phpcs --standard=path/to/core/ruleset.xml $@ Maybe it would have to strip out any |
I could probably include it in wrapper (and probably will to test later), just not sure what is the right way here from CS perspective as well. Are sets of sniffs supposed to be able to contain multiple Probably need to read up on ruleset creation docs, been a while since I looked. |
Yeah, I need to look into how rulesets can be composed as well. I do know that PHPCS 5 is going to allow combining rulesets via
|
@Rarst I think having a selected set of rules - not all - in a default ruleset is not currently possible with the format implemented for ruleset XMLs as per documentation, as you cannot exclude local sniffs from the same ruleset packae, you can only exclude sniffs from included packages. So we're stuck with default containing all rules, and having other XMLs introduce specific sets of checks. And i think bundling other rulesets does not affect normal flow of phpcs, it should exist as a guide to people not needing the full strict set of sniffs. And with new feature of being able to combine multiple standards/sniffs/XMLs using |
Has been resolved by current multi–folder/standard structure. |
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
Related: * `Universal.Namespaces.OneDeclarationPerFile` - upstream Extra WordPress#6 * `Universal.Namespaces.DisallowCurlyBraceSyntax` - upstream Extra WordPress#4 * `Universal.Namespaces.DisallowDeclarationWithoutName` - upstream Extra WordPress#50 * `Universal.UseStatements.NoLeadingBackslash` - upstream Extra WordPress#46 * `Universal.UseStatements.LowercaseFunctionConst` - upstream Extra WordPress#58 * `Universal.Constants.LowercaseClassResolutionKeyword` - upstream Extra WordPress#72 * `Generic.WhiteSpace.IncrementDecrementSpacing` - issue WordPress#1511, upstream PHPCS WordPress#2172, WordPress#2174 * `Universal.Operators.DisallowStandalonePostIncrementDecrement` - upstream Extra WordPress#65 * `Universal.Constants.UppercaseMagicConstants` - upstream Extra WordPress#64
A lot of the sniffs are opinionated and may not be reflective of an actual problem. We should have a ruleset XML file that just contains the core sniffs for checking code formatting, and then another ruleset XML that has the extra sniffs (e.g. those labeled with
extra
in GitHub), perhaps including the other ruleset XML as a base or copying it somehow.The text was updated successfully, but these errors were encountered: