mirror of https://github.com/zulip/zulip.git
semgrep: Broaden select_related() and prefetch_related() rules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
a20b454ebb
commit
0cc40605b0
|
@ -45,8 +45,8 @@ rules:
|
|||
|
||||
- id: dont-use-empty-select_related
|
||||
pattern-either:
|
||||
- pattern: $X.objects. ... .select_related()
|
||||
- pattern: $X.objects. ... .prefetch_related()
|
||||
- pattern: $X.select_related()
|
||||
- pattern: $X.prefetch_related()
|
||||
message: |
|
||||
Do not use a bare '.select_related()' or '.prefetch_related()', which can join many more tables than expected. Specify the relations to follow explicitly.
|
||||
languages: [python]
|
||||
|
|
Loading…
Reference in New Issue