From 0a420813db3df91505b73f76a8d8d65578c04ea9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 18 Jan 2021 17:28:34 +0100 Subject: lint: Add initial semgrep config --- .semgrep.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .semgrep.yml 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] -- cgit v1.2.3