From 236c84ab8bbba439057149c9a20eb289f7b85b52 Mon Sep 17 00:00:00 2001 From: abhishek Date: Mon, 18 Oct 2021 16:35:13 +0530 Subject: [PATCH] feat: semgrep rule for db.sql --- .github/helper/semgrep_rules/frappe_correctness.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/helper/semgrep_rules/frappe_correctness.yml b/.github/helper/semgrep_rules/frappe_correctness.yml index d9603e89aa..04341b3430 100644 --- a/.github/helper/semgrep_rules/frappe_correctness.yml +++ b/.github/helper/semgrep_rules/frappe_correctness.yml @@ -131,3 +131,10 @@ rules: key `$X` is uselessly assigned twice. This could be a potential bug. languages: [python] severity: ERROR + +- id: frappe-using-db.sql + pattern-regex: \.sql.*\( + message: | + The PR contains a SQL query that may be re-written with frappe.qb (https://frappeframework.com/docs/user/en/api/query-builder) or the Database API (https://frappeframework.com/docs/user/en/api/database) + languages: [python] + severity: ERROR \ No newline at end of file