-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Remove or update stale PHPCS annotations #10903
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
base: trunk
Are you sure you want to change the base?
Remove or update stale PHPCS annotations #10903
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
@rodrigoprimo Could you please rebase your branch? Some parts of this PR were already committed in 259d1f9, so we’ll need to sync it with the latest trunk before proceeding. |
…ted.php` Remove `PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore` annotations from `__ngettext()` and `__ngettext_noop()`. Since PHPCompatibility 9.3.2, the `ReservedFunctionNames` sniff skips functions that have a `@deprecated` tag in their docblock, making these annotations unnecessary. See PHPCompatibility/PHPCompatibility 917.
…Font_Collections_Controller` Remove the `VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable` annotation from `get_items_permissions_check()`. The VariableAnalysis standard is not installed in WordPress Core. The annotation was probably carried over from Gutenberg, where VariableAnalysis is part of the PHPCS configuration, when the font library was merged into Core.
…Twenty-One Remove three `WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound` annotations. The WPThemeReview standard is not installed in WordPress Core. I believe these annotations were carried over from the upstream Twenty Twenty-One repository when the theme was imported into Core in 4b90066.
The `// WPCS: XSS OK.` comments use a legacy annotation format no longer recognized by PHPCS. This format was introduced in WPCS 0.4.0, deprecated in WPCS 2.0.0 (see WordPress/WordPress-Coding-Standards 1580), and support was fully removed in WPCS 3.0.0 (see WordPress/WordPress-Coding-Standards 1908) in favor of the PHPCS native `phpcs:ignore` annotations. Additionally, the `WordPress.Security.EscapeOutput` sniff these comments reference is part of the `WordPress-Extra` standard, not the `WordPress-Core` standard used in this repository.
…cons The `CapitalPDangit` sniff does not check array keys.
…ecked in this repository The `phpcs.xml.dist` configuration uses the `WordPress-Core` standard. These annotations reference sniffs that are part of `WordPress-Extra`, which is not included: - `WordPress.Security.EscapeOutput` - `WordPress.Security.NonceVerification` - `WordPress.WP.AlternativeFunctions` - `WordPress.PHP.DevelopmentFunctions` - `WordPress.PHP.IniSet` Some of these annotations were carried over from upstream theme repositories or external plugins. If in the future there is a decision to add `WordPress-Extra`, I think it makes sense to evaluate each error/warning to decide what should be ignored and what should not.
6d96efd to
5405ccb
Compare
|
@mukeshpanchal27, thanks for the ping. I just rebased this PR with the latest from trunk. |
Trac ticket: https://core.trac.wordpress.org/ticket/64627
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.