Skip to content

Commit 896c885

Browse files
committed
docs: update pre-commit section with args example, fix stale v1.3.0 refs
- pre-commit section: add args example for Alembic and Django, note on pre-commit autoupdate, update rev from v1.3.0 to v1.2.0 - Remove (v1.3.0) version labels from section headers for unreleased features - Update 'What's new' section to reflect v1.2.0 accurately Closes #35
1 parent 649e3a4 commit 896c885

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pip install pytest-mrt[oracle] # python-oracledb
137137
pip install pytest-mrt[mssql] # pymssql
138138
```
139139

140-
## Auto-fix missing reverse operations (v1.3.0)
140+
## Auto-fix missing reverse operations
141141

142142
`mrt fix` generates missing reverse operations for both Alembic and Django migrations.
143143

@@ -158,18 +158,29 @@ mrt clean-backups --db $DATABASE_URL
158158
mrt clean-backups --db $DATABASE_URL --label 0042_remove_user_phone --yes
159159
```
160160

161-
## pre-commit integration (v1.3.0)
161+
## pre-commit integration
162162

163163
Add to `.pre-commit-config.yaml` to run `mrt check` automatically before every push:
164164

165165
```yaml
166+
# Alembic
166167
- repo: https://github.com/croc100/pytest-mrt
167-
rev: v1.3.0
168+
rev: v1.2.0
168169
hooks:
169170
- id: mrt-check
171+
args: [alembic/versions/]
172+
173+
# Django
174+
- repo: https://github.com/croc100/pytest-mrt
175+
rev: v1.2.0
176+
hooks:
177+
- id: mrt-check
178+
args: [myapp/migrations/]
170179
```
171180
172-
## Incremental CI — `--since` (v1.3.0)
181+
Update `rev` to the latest release tag. Run `pre-commit autoupdate` to keep it current.
182+
183+
## Incremental CI — `--since`
173184

174185
Check only migrations added since a given revision. Keeps CI fast on large codebases:
175186

@@ -247,12 +258,13 @@ To suppress all MRT warnings on a line:
247258

248259
Legacy syntax `# mrt: ignore` is still supported for backward compatibility.
249260

250-
## What's new in v1.3.0
261+
## What's new in v1.2.0
251262

252-
- **Django-aware `mrt fix`** — auto-generates reverse operations and data-safe backup/restore code for `RemoveField` and `DeleteModel`
253-
- **`mrt clean-backups`** — removes `_mrt_backups` rows after a deployment is confirmed stable
254-
- **`mrt check --since <revision>`** — incremental scan; only checks migrations added since a given git ref
255-
- **pre-commit hook** — add two lines to `.pre-commit-config.yaml` and `mrt check` runs automatically before every push
263+
- **MRT rule codes** (MRT101-MRT902) on all 44 patterns
264+
- **`# noqa: MRTxxx` suppression** — ruff/flake8-compatible per-line suppression syntax
265+
- **CLI refactored** into `commands/` subpackage
266+
- **`mrt check --since <revision>`** — incremental scan; only checks migrations added since a given revision
267+
- **pre-commit hook** — add to `.pre-commit-config.yaml` and `mrt check` runs automatically before every push
256268

257269
## Changelog
258270

0 commit comments

Comments
 (0)