Files
zulip/tools/sgrep.yml
brendon f65e6d0d94 sgrep: Install syntactic code search tool as an external linter.
Add sgrep (sgrep.dev) to tooling and include simple rule as
proof of concept. Included rule detects use of old django render
function.

Also added a rule that looks for if-else statements where both
code paths are identical.
2020-04-01 15:08:34 -07:00

19 lines
559 B
YAML

# See https://github.com/returntocorp/sgrep/blob/develop/docs/config.md for sgrep rule format
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