Skip to content

Commit f6a4a16

Browse files
authored
Merge pull request #690 from Automattic/update/variableanalysis-configure
Update WordPress-VIP-Go/ruleset.xml to configure VariableAnalysis
2 parents 086b3da + 1d378b2 commit f6a4a16

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

WordPress-VIP-Go/ruleset.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,15 @@
251251
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable">
252252
<severity>0</severity>
253253
</rule>
254+
255+
<!-- Do not report on undefined variables before require nor in file scope. -->
256+
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
257+
<properties>
258+
<property name="allowUnusedVariablesBeforeRequire" value="true"/>
259+
<property name="allowUndefinedVariablesInFileScope" value="true"/>
260+
</properties>
261+
</rule>
262+
254263
<rule ref="WordPress.DB.SlowDBQuery.slow_db_query_meta_key">
255264
<!-- We are silencing this one because VIP Go has a combined index on meta_key, meta_value-->
256265
<severity>0</severity>

0 commit comments

Comments
 (0)