-
Notifications
You must be signed in to change notification settings - Fork 21
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
Bump VariableAnalysis to 2.9.0 to allow use of the backported options #120
Comments
@GaryJones: Are the options |
@sirbrillig can confirm the option names, but they look right to me. If you don't have the config in a config file, then yes, |
You can see the full list of options available here: https://github.com/sirbrillig/phpcs-variable-analysis/tree/v2.9.0#customization |
@GaryJones: It seems that this cannot be done via
And using these options via
as it results in:
I did try a number of variations. When I tried adding this to the
I think in order to get this working, we need to add this to the WordPress-VIP-Go ruleset. I can open a PR if needed, just let me know. |
@GaryJones, @rebeccahum: I just wanted to check if this was resolved? Should I submit a Pull-Request for this? Happy to do so. |
Go ahead with the PR please :-) |
Resolved here. |
What problem would the enhancement address for VIP?
When template partials are
require
'd from within a class, then the partial may use$this->...
to insert display a value. At PHP runtime, it works, but for PHPCS analysis, it sees a PHP file with an undefined$this
and so reports it via the VariableAnalysis package. Technically it's correct, and while it could be ignored, it's not practical or desirable to do that.Describe the solution you'd like
VariableAnalysis 2.9.0 includes two new options that can control whether these violations are raised.
VIPCS already requires
^2.8.3
, so the code analysis bot could simply pull in the updated version of VA without changes to VIPCS.Both options could then be set in the config when looking at code.
What code should be reported as a violation?
–
What code should not be reported as a violation?
Don't report on
$this
:Don't report on
$args
(new feature in WP 5.5):The text was updated successfully, but these errors were encountered: