Skip to content

Commit 2a2d2e4

Browse files
committed
Introduce semgrep
Introduce usage of semgrep by doing: - Add a `semgrep` config file in `contrib/semgrep.yml`. - Add a single rule to check that all `From` impls are inlined
1 parent 44015f1 commit 2a2d2e4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

contrib/semgrep.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
rules:
2+
3+
- id: inline-from-impls
4+
languages:
5+
- rust
6+
message: Use inline attribute on `From` implementations.
7+
patterns:
8+
- pattern-regex: 'From<[A-Za-z]+> for [A-Za-z]+ \{$\n'
9+
- pattern-not-regex: 'From<[A-Za-z]+> for [A-Za-z]+ \{$\n^ \#\[inline\]'
10+
severity: WARNING

0 commit comments

Comments
 (0)