3YOURMIND / django-migration-linter

:rocket: Detect backward incompatible migrations for your django project
https://pypi.python.org/pypi/django-migration-linter/
Apache License 2.0
524 stars 57 forks source link

Add `--exclude-migrations-from` #284

Closed restaste closed 6 months ago

restaste commented 7 months ago

Hello, and thanks for that great tool!

We're in the process of introducing migrations linting in our CI pipelines (to move towards only bw-compatible migrations, to further eliminate downtime).

We don't want to commit to 100% bw-compatible migrations just yet, so we'll need to rely on ignoring migrations. All of the currently available methods pose a small problem for us:

Notably, there's --include-migrations-from which I feel is exactly what we'd want, but for exclusion: putting migration file names in a dedicated file clearly separates the concerns.

So I wonder whether you considered adding an --exclude-migrations-from option, which would take a file containing names of migrations to exclude from linting? I guess one open question would be how this plays with the other include/exclude options.

Arguably, none of our small gripes above are hard blockers (we'd probably start with --ignore-name), but you're open to it, I'd happily set some time aside to work on this.

Also: maybe I missed something and my concerns aren't justified. Feel free to educate me if that's the case!

restaste commented 6 months ago

I spent some more time reading through the docs and ended up putting all my exclusions in a .django_migration_linter.cfg file, which worked out exactly how I wanted.