Skip to content

Commit 7fd2e99

Browse files
committed
chore: add semgrep python-forbid-direct-logging-import.yaml rule (#14)
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 079a926 commit 7fd2e99

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rules:
2+
- id: python-forbid-direct-logging-import
3+
languages: [python]
4+
severity: WARNING
5+
message: "Import from `xcp_storage.log`, not from `logging`."
6+
paths:
7+
exclude:
8+
- src/xcp_storage/log.py
9+
pattern-either:
10+
- pattern: import logging
11+
- pattern: import logging.$X
12+
- pattern: from logging import $X
13+
- pattern: from logging.$X import $Y

0 commit comments

Comments
 (0)