fix bugs
1. "first keyword: --" cosmetic bug 2. re error
This commit is contained in:
@@ -32,7 +32,7 @@ import os
|
||||
SCRIPTS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, SCRIPTS_DIR)
|
||||
|
||||
from sql_guard import assert_select_or_insert # noqa: E402
|
||||
from sql_guard import assert_select_or_insert, first_keyword # noqa: E402
|
||||
|
||||
|
||||
def read_sql() -> str:
|
||||
@@ -51,7 +51,7 @@ def main() -> int:
|
||||
except ValueError as e:
|
||||
print(f"FAIL - {e}")
|
||||
return 1
|
||||
first = body.split(None, 1)[0].lower()
|
||||
first = first_keyword(sql)
|
||||
print(f"PASS - first keyword: {first}, body length: {len(body)}")
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user