Introduce some rules for checking cppcheck's use of Token::*Match
This commit is contained in:
parent
ffc4bb481b
commit
9075ca59ca
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<rule version="1">
|
||||||
|
<pattern>Token :: (?:findm|(?:simple|)M)atch \([^,]+,\s+"\s+</pattern>
|
||||||
|
<message>
|
||||||
|
<id>TokenMatchSpacing</id>
|
||||||
|
<severity>style</severity>
|
||||||
|
<summary>Useless extra spacing for Token::*Match.</summary>
|
||||||
|
</message>
|
||||||
|
</rule>
|
||||||
|
<rule version="1">
|
||||||
|
<pattern>Token :: Match \([^,]+,\s+"[^%|!\[\]]+"</pattern>
|
||||||
|
<message>
|
||||||
|
<id>UseTokensimpleMatch</id>
|
||||||
|
<severity>error</severity>
|
||||||
|
<summary>Token::simpleMatch should be used to match tokens
|
||||||
|
without special pattern requirements.</summary>
|
||||||
|
</message>
|
||||||
|
</rule>
|
Loading…
Reference in New Issue