You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detect & forbid blanket PHPCS ignores.
The new annotations allow to indicate which Standard/Category/Sniff/Errorcode should be temporarily ignored/disabled.
Sniff/Errorcode ignore/disables will be allowed. Errorcode based ones are preferred.
Standard/Category ignores/disables will not be allowed.
File ignores will not be allowed. These should be done from within the ruleset and documented there.
All temporary disables should be accompanied by a (re-) enable.
All ignores/disables should be accompanied by a reason for the ignore/disable.
This sniff will only be able to work when PHPCS is run with --ignore-annotations as otherwise errors on annotation tokens will be, well, ignored (default behaviour).
This means a secondary PHPCS run will be added to the Travis script if & when this sniff has been added to YoastCS and a plugin upgrades to the YoastCS version which includes it. This secondary run will only check against this particular sniff.
@moorscode In your opinion, does this summarize correctly what we discussed ?
moorscode
changed the title
Create a new sniff to safeguard that PHPCS annotations aren't being abused
Create a sniff to safeguard that PHPCS annotations aren't being abused
Feb 10, 2018
Maybe a ticket should be opened upstream about the fact that lines which only contain ignore annotations will never show an error/warning. (not even for the indent being wrong)
As previously discussed with @moorscode, this sniff should:
I.e. the following will no longer be allowed:
@codingStandardsIgnoreFile
@codingStandardsIgnoreStart
/@codingStandardsIgnoreEnd
@codingStandardsIgnoreLine
@codingStandardsChangeSetting
The new annotations allow to indicate which Standard/Category/Sniff/Errorcode should be temporarily ignored/disabled.
enable
.This sniff will only be able to work when PHPCS is run with
--ignore-annotations
as otherwise errors on annotation tokens will be, well, ignored (default behaviour).This means a secondary PHPCS run will be added to the Travis script if & when this sniff has been added to YoastCS and a plugin upgrades to the YoastCS version which includes it. This secondary run will only check against this particular sniff.
@moorscode In your opinion, does this summarize correctly what we discussed ?
Refs:
The text was updated successfully, but these errors were encountered: