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

Replace deprecated // WPCS: syntax #581

Closed
richaber opened this issue Feb 11, 2021 · 0 comments · Fixed by #605
Closed

Replace deprecated // WPCS: syntax #581

richaber opened this issue Feb 11, 2021 · 0 comments · Fixed by #605
Assignees

Comments

@richaber
Copy link
Contributor

The // WPCS: syntax for whitelisting/ignoring, was specific to WPCS and is deprecated.

Per the WordPress Coding Standards wiki

Sometimes, a block of code will be flagged by WPCS with an error which you wish to ignore. An example of this could be a variable which is sanitised or escaped elsewhere before being used or output.
PHPCS lets you whitelist given errors for a line or block of code.
Example: // phpcs:ignore WordPress.Security.EscapeOutput.
Note that WPCS had native whitelist comments like below:
// Input var okay.
or
// WPCS: Input var okay.
These have been deprecated in WPCS 2.0.0 and will be removed in WPCS 3.0.0. The PHPCS format (// phpcs:ignore) is the preferred format.

I intend to submit a PR to replace the deprecated syntax.

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

Successfully merging a pull request may close this issue.

1 participant