-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.pre-commit-hooks.yaml
More file actions
35 lines (33 loc) · 1.24 KB
/
Copy path.pre-commit-hooks.yaml
File metadata and controls
35 lines (33 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# pre-commit hook definitions for django-orm-lens.
#
# Usage in a Django project's .pre-commit-config.yaml:
#
# repos:
# - repo: https://github.com/FROWNINGdev/django-orm-lens
# rev: py-v1.8.1
# hooks:
# - id: django-orm-lens-nplusone
# - id: django-orm-lens-migration-risk
#
# The hook environment installs the published PyPI package (see the root
# pyproject.toml shim). Pin the analyzer itself with:
# additional_dependencies: ["django-orm-lens==1.4.0"]
- id: django-orm-lens-nplusone
name: django-orm-lens · static N+1 check
description: >-
Flag FK/M2M access inside loops without select_related/prefetch_related.
Static analysis — no DB, no Django boot. Exits non-zero on findings.
entry: django-orm-lens nplusone --confidence high
language: python
pass_filenames: false
types: [python]
- id: django-orm-lens-migration-risk
name: django-orm-lens · migration risk check
description: >-
Flag migration operations that are dangerous on a production database
(NOT NULL without default, table-locking index builds, irreversible
data migrations, ...). Exits non-zero on critical findings.
entry: django-orm-lens migration-risk
language: python
pass_filenames: false
types: [python]