Skip to content

Commit 330dd4c

Browse files
author
Gudmundur Haraldsson
committed
Update ruleset.xml to configure VariableAnalysis
1 parent 086b3da commit 330dd4c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

WordPress-VIP-Go/ruleset.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,16 @@
251251
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable">
252252
<severity>0</severity>
253253
</rule>
254+
255+
<!-- Do not report on undefined variables before require nor
256+
in file scope. See discussion here: https://github.com/Automattic/vip-go-ci/issues/120 -->
257+
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
258+
<properties>
259+
<property name="allowUnusedVariablesBeforeRequire" value="true"/>
260+
<property name="allowUndefinedVariablesInFileScope" value="true"/>
261+
</properties>
262+
</rule>
263+
254264
<rule ref="WordPress.DB.SlowDBQuery.slow_db_query_meta_key">
255265
<!-- We are silencing this one because VIP Go has a combined index on meta_key, meta_value-->
256266
<severity>0</severity>

0 commit comments

Comments
 (0)