zulip/tools/semgrep.yml

29 lines
848 B
YAML
Raw Normal View History

# See https://github.com/returntocorp/semgrep/blob/experimental/docs/config/advanced.md
rules:
####################### PYTHON RULES #######################
- id: deprecated-render-usage
pattern: django.shortcuts.render_to_response(...)
message: "Use render() (from django.shortcuts) instead of render_to_response()"
languages: [python]
severity: ERROR
- id: useless-if-body
patterns:
- pattern: |
if $X:
$S
else:
$S
message: "Useless if statment; both blocks have the same body"
languages: [python]
severity: ERROR
- id: dont-use-stream-objects-filter
pattern: Stream.objects.filter(...)
message: "Please use access_stream_by_*() to fetch Stream objects"
languages: [python]
severity: ERROR
paths:
- directory: "zerver/views/"