Remove <rules>...</rules>, added by 52aab1e80c which broke internal checking. In addition another internal rule was added, following up the changes from https://github.com/danmar/cppcheck/pull/4182/files

This commit is contained in:
orbitcowboy 2022-06-21 16:10:50 +02:00
parent a658baf962
commit 78804ca18c
1 changed files with 40 additions and 35 deletions

View File

@ -1,5 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<rules>
<rule version="1"> <rule version="1">
<pattern>Token :: (?:findm|(?:simple|)M)atch \([^,]+,\s+"(?:\s+|[^"]+?\s+")</pattern> <pattern>Token :: (?:findm|(?:simple|)M)atch \([^,]+,\s+"(?:\s+|[^"]+?\s+")</pattern>
<message> <message>
@ -9,12 +8,11 @@
</message> </message>
</rule> </rule>
<rule version="1"> <rule version="1">
<pattern>(?U)Token :: Match \([^,]+,\s+"[^%|!\[\]]+"</pattern> <pattern>(?U)Token :: Match \([^,]+,\s+"[^%|!\[\]]+" \)</pattern>
<message> <message>
<id>UseTokensimpleMatch</id> <id>UseTokensimpleMatch</id>
<severity>error</severity> <severity>error</severity>
<summary>Token::simpleMatch should be used to match tokens <summary>Token::simpleMatch should be used to match tokens without special pattern requirements.</summary>
without special pattern requirements.</summary>
</message> </message>
</rule> </rule>
<rule version="1"> <rule version="1">
@ -33,4 +31,11 @@ without special pattern requirements.</summary>
<summary>tok->strAt(0) is a slow way to say tok->str()</summary> <summary>tok->strAt(0) is a slow way to say tok->str()</summary>
</message> </message>
</rule> </rule>
</rules> <rule version="1">
<pattern><![CDATA[Token :: Match \( (\b\w+\b) , \"%var%\" \) && (\b\1\b) \. variable \( \)]]></pattern>
<message>
<id>TokenMatchVariable</id>
<severity>error</severity>
<summary>Simplify 'Token :: Match ( expr , %var% ) &amp;&amp; expr->variable()' to 'expr->variable()'</summary>
</message>
</rule>