I'm setting up PHP CodeSniffer as a linter for my code and I have an error which I want to ignore.
In order to do that, I should be able to put the line // phpcs:ignore Name.Of.The.Rule
before the line that is an exception to that rule.
Unfortunately, I don't know how I can find which of the rules I have to ignore. Is there a way to display the rule producing the error?
For now, I searched the error message in my vendor
folder, resulting in 4 different entries. I'm not sure I know which is the one called.
The error summary looks like that:
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
14 | ERROR | Method name "ActivityRules::is_after" is not in camel
| | caps format
----------------------------------------------------------------------
I would love to have something like that:
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
14 | ERROR | Method name "ActivityRules::is_after" is not in camel | SomeStandard.Category
| | caps format | .NameOfTheSniff.RuleCalled
---------------------------------------------------------------------------------------------------
EDIT:
I don't need you to tell me it's PSR1.Methods.CamelCapsMethodName.NotCamelCaps
, I know how to find the rule by hand the hard way, by trial and error. I'd like to know if there is an easy way to do it.