Skip to content

Commit

Permalink
Add semgrep rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dfarr committed Aug 31, 2023
1 parent 5c73832 commit 91e458e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}

semgrep:
name: semgrep/ci
name: semgrep
runs-on: ubuntu-20.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
Expand Down
11 changes: 11 additions & 0 deletions semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
rules:
- id: range-over-map
pattern-either:
- pattern: |
for $K, $V := range ($MAP : map[$KT]$VT) { ... }
- pattern: |
for $K := range ($MAP : map[$KT]$VT) { ... }
message: Ranging over a map is non deterministic
languages:
- go
severity: ERROR

0 comments on commit 91e458e

Please sign in to comment.