Skip to content

Commit 135bf74

Browse files
committed
chore: add semgrep python-enforce-class-pascal-case rule (#14)
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 3f1d24c commit 135bf74

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
rules:
2+
- id: python-enforce-class-pascal-case
3+
languages: [python]
4+
severity: WARNING
5+
message: "Class `$CLASS` must respect PascalCase style."
6+
7+
patterns:
8+
- pattern: |
9+
class $CLASS(...):
10+
...
11+
12+
- metavariable-regex:
13+
metavariable: $CLASS
14+
regex: '^(?!_?([A-Z][a-z0-9]+)+$)'

0 commit comments

Comments
 (0)