open-vault/tools/semgrep/ci/return-nil.yml
mcollao-hc 5ec0d57313
PSP-256 - Add security-scanner tool (#17988)
Add security-scanner tool and github workflow
2022-11-17 17:12:03 -06:00

20 lines
416 B
YAML

rules:
- id: hc-return-nil
patterns:
- pattern-either:
- pattern: |
if $X == nil {
return $X
}
- pattern: |
if $X != nil {
return ...
}
return $X
message: return nil instead of nil value
languages:
- go
severity: ERROR
metadata:
license: MIT