Add a few more rules
This commit is contained in:
parent
2b77e3591e
commit
43b0e655bb
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<rule version="1">
|
||||
<pattern>Severity :: fromString \( "\w+" \)</pattern>
|
||||
<message>
|
||||
<id>ConstantSeverityFromString</id>
|
||||
<severity>style</severity>
|
||||
<summary>Constant severity lookups should be done via
|
||||
Severity::constant.</summary>
|
||||
</message>
|
||||
</rule>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0"?>
|
||||
<rule version="1">
|
||||
<!-- This should ideally be checked by lib/checkstl.cpp -->
|
||||
<pattern> \. find \( "[^"]+?" \) == \d+ </pattern>
|
||||
<message>
|
||||
<id>UselessSTDStringFind</id>
|
||||
<severity>performance</severity>
|
||||
<summary>When looking for a string at a fixed position compare
|
||||
is faster.</summary>
|
||||
</message>
|
||||
</rule>
|
Loading…
Reference in New Issue