aboutsummaryrefslogtreecommitdiffstats
path: root/.semgrep.yml
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-18 17:28:34 +0100
committerKim Alvefur <zash@zash.se>2021-01-18 17:28:34 +0100
commit0a420813db3df91505b73f76a8d8d65578c04ea9 (patch)
tree89ccbe0692061695169d0d471a3ed1fc172069ce /.semgrep.yml
parent2f9a03eba0da1afe25aa36aec6a76f22c5d4f346 (diff)
downloadprosody-0a420813db3df91505b73f76a8d8d65578c04ea9.tar.gz
prosody-0a420813db3df91505b73f76a8d8d65578c04ea9.zip
lint: Add initial semgrep config
Diffstat (limited to '.semgrep.yml')
-rw-r--r--.semgrep.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/.semgrep.yml b/.semgrep.yml
new file mode 100644
index 00000000..de1ef89e
--- /dev/null
+++ b/.semgrep.yml
@@ -0,0 +1,24 @@
+rules:
+- id: log-variable-fmtstring
+ patterns:
+ - pattern: log("...", $A)
+ - pattern-not: log("...", "...")
+ message: Variable passed as format string to logging
+ languages: [lua]
+ severity: ERROR
+- id: module-log-variable-fmtstring
+ patterns:
+ - pattern: module:log("...", $A)
+ - pattern-not: module:log("...", "...")
+ message: Variable passed as format string to logging
+ languages: [lua]
+ severity: ERROR
+- id: module-getopt-string-default
+ patterns:
+ - pattern: module:get_option_string("...", $A)
+ - pattern-not: module:get_option_string("...", "...")
+ - pattern-not: module:get_option_string("...", host)
+ - pattern-not: module:get_option_string("...", module.host)
+ message: Non-string default from :get_option_string
+ severity: ERROR
+ languages: [lua]