Skip to content

Commit a6afd1a

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 31f1a0f commit a6afd1a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

contrib/semgrep.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
rules:
2+
3+
- id: inline-from-impls
4+
patterns:
5+
- pattern: |-
6+
impl From<$F> for $T { fn from(...) -> $SELF { ... } }
7+
- pattern-not-regex: '\#\[inline\]'
8+
message: Use inline attribute on `From` implementations.
9+
languages:
10+
- rust
11+
severity: ERROR

0 commit comments

Comments
 (0)