Compare commits

...

1 Commits

Author SHA1 Message Date
Charlie Marsh
b9a119d335 Add an example ast-grep rule (sg scan resources/test/cpython/) 2022-11-07 14:50:48 -05:00
3 changed files with 15 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
import os.path
import ospath
from os import path
import some as sum
from some import other as int

10
rules/no-os.yml Normal file
View File

@@ -0,0 +1,10 @@
id: C001
message: Don't import os
severity: warning
language: Python
rule:
any:
- pattern: import os
- pattern: import os.$_
- pattern: from os import $_
- pattern: from os.$_ import $_

2
sgconfig.yml Normal file
View File

@@ -0,0 +1,2 @@
ruleDirs:
- rules