aboutsummaryrefslogtreecommitdiffhomepage
path: root/.cppcheck.rule
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-06-17 20:16:21 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-06-17 20:16:21 -0700
commitdc58edd521942c0a5a42541d5b5c39b09c226665 (patch)
treef68df7afd78e084ae4771219ac658c3a18427a7b /.cppcheck.rule
parente6d4ac5ee25f09bd661e0360844ca107fb6c3491 (diff)
implement custom cppcheck rules
I recently noticed there were several invocations of `wcwidth()` that should have been `fish_wcwidth()`. This adds custom cppcheck rules to detect that mistake.
Diffstat (limited to '.cppcheck.rule')
-rw-r--r--.cppcheck.rule18
1 files changed, 18 insertions, 0 deletions
diff --git a/.cppcheck.rule b/.cppcheck.rule
new file mode 100644
index 00000000..d8f67a83
--- /dev/null
+++ b/.cppcheck.rule
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<rule version="1">
+ <pattern> wcwidth \(</pattern>
+ <message>
+ <id>wcwidthForbidden</id>
+ <severity>warning</severity>
+ <summary>Always use fish_wcwidth rather than wcwidth.</summary>
+ </message>
+</rule>
+
+<rule version="1">
+ <pattern> wcswidth \(</pattern>
+ <message>
+ <id>wcswidthForbidden</id>
+ <severity>warning</severity>
+ <summary>Always use fish_wcswidth rather than wcswidth.</summary>
+ </message>
+</rule>