Skip to content
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

WhiteSpace.PrecisionAlignment: Allow for the new PHPCS ignore comments #1218

Closed
jrfnl opened this issue Oct 31, 2017 · 1 comment · Fixed by #1407
Closed

WhiteSpace.PrecisionAlignment: Allow for the new PHPCS ignore comments #1218

jrfnl opened this issue Oct 31, 2017 · 1 comment · Fixed by #1407

Comments

@jrfnl
Copy link
Member

jrfnl commented Oct 31, 2017

PHPCS 3.2.0 will bring a new inline ignore annotations.

WPCS contains two sniffs which examine a complete file based on a T_OPEN_TAG.

For the Files.FileName sniff, the changes are irrelevant in my opinion.

However, the WhiteSpace.PrecisionAlignment sniff, should start to allow for the new annotations.

The following two commits show how this is handled/fixed in one of the upstream sniffs:

@jrfnl
Copy link
Member Author

jrfnl commented Feb 27, 2018

I've investigated this and the issue with the upstream sniff referred to is caused by all errors thrown by the sniff being reported on line 1.
This is not the case for the WordPress.WhiteSpace.PrecisionAlignment sniff which reports each issue on the line where it is found.
This means that no extra provisions need to be made for the new annotations in the WordPress.WhiteSpace.PrecisionAlignmentsniff.

However, they should possibly be made in the Files.FileName sniff, though it would be more customary for files to be excluded from that sniff from the ruleset.
All the same, I believe the sniff should respect the PHPCS annotations when found, so I'll look into fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant