Skip to content

Commit 11e4358

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 11e4358

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

contrib/semgrep.yml

Lines changed: 11 additions & 0 deletions
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)