graze / standards

⚖ The coding standards of the graze tech team.
https://graze.github.io/standards/
MIT License
6 stars 2 forks source link

Fix sniff names that get printed #49

Closed biggianteye closed 4 years ago

biggianteye commented 4 years ago

Making sure that the message produced via phpcs -s actually matches the sniff name, for ease of working further with this.

Previously you would see this:

------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
 13 | ERROR | Space found after logical NOT operator
    |       | (graze.controlStructures.NegationNoSpaces)
------------------------------------------------------------------------------------------------

That's not the name of the sniff and so if you try to do anything with that (eg. adding it to a ruleset) phpcs will complain that the sniff does not exist.

Now you will correctly see this instead:

------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
 13 | ERROR | Space found after logical NOT operator
    |       | (Graze.ControlStructures.NegationNoSpaces)
------------------------------------------------------------------------------------------------