Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

semgrep: Add rule to specify tick kwarg on time_machine.travel() calls.

Mateusz Mandera0e4532f8e7d4
diff --git a/tools/semgrep-py.yml b/tools/semgrep-py.yml
index 126d468fbc0..c8a39fec2aa 100644
--- a/tools/semgrep-py.yml
+++ b/tools/semgrep-py.yml
@@ -17,6 +17,15 @@ rules:
include:
- zerver/views/
+ - id: time-machine-travel-specify-tick
+ patterns:
+ - pattern: time_machine.travel(...)
+ - pattern-not: time_machine.travel(..., tick=..., ...)
+ message: |
+ Specify tick kwarg value for time_machine.travel(). Most cases will want to use False.
+ languages: [python]
+ severity: ERROR
+
- id: limit-message-filter
patterns:
- pattern: Message.objects.filter(...)