Skip to content

Commit 8dc5d94

Browse files
committed
chore: add semgrep python-forbid-direct-typing-import rule (#14)
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 5575493 commit 8dc5d94

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-typing-import
3+
languages: [python]
4+
severity: WARNING
5+
message: "Import from `xcp_storage.typing`, not from `typing` or `typing_extensions`."
6+
paths:
7+
exclude:
8+
- src/xcp_storage/typing/
9+
pattern-either:
10+
- pattern: from typing import $X
11+
- pattern: from typing_extensions import $X
12+
- pattern: import typing
13+
- pattern: import typing_extensions

0 commit comments

Comments
 (0)