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:
linter.IgnoreMigration() means our migration scripts need a reference to the linter. We'd prefer to keep things separate (i.e. have migrations contain only migration-related concerns).
--ignore-name means our CI scripts will start containing migration file names and will quickly grow as we add non-bw-migrations.
--ignore-name-contains means we can't name our files however we want.
--include-*: we want to default to "all migrations are linted" and specify exclusions individually.
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!
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.
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:
linter.IgnoreMigration()
means our migration scripts need a reference to the linter. We'd prefer to keep things separate (i.e. have migrations contain only migration-related concerns).--ignore-name
means our CI scripts will start containing migration file names and will quickly grow as we add non-bw-migrations.--ignore-name-contains
means we can't name our files however we want.--include-*
: we want to default to "all migrations are linted" and specify exclusions individually.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!