Skip to content

feat(cli): mops lint honors [migrations].check-limit#525

Merged
Kamirus merged 2 commits intomainfrom
feat/lint-trim-migrations
Apr 29, 2026
Merged

feat(cli): mops lint honors [migrations].check-limit#525
Kamirus merged 2 commits intomainfrom
feat/lint-trim-migrations

Conversation

@Kamirus
Copy link
Copy Markdown
Collaborator

@Kamirus Kamirus commented Apr 29, 2026

mops lint now skips chain migrations excluded by [canisters.<name>.migrations].check-limit, so projects with hundreds of frozen migrations lint as fast as they type-check. Previously lint walked all **/*.mo regardless of the limit, defeating the speed knob mops check already had.

Pass an explicit filter (mops lint <name>) or a file path to lint a trimmed migration on demand.

Caveat: mops lint now reads [canisters.*.migrations] to compute the trim, so misconfig (invalid check-limit, missing chain dir, etc.) now fails here with the same error mops check produces.

Kamirus added 2 commits April 29, 2026 13:55
Trims frozen chain migration files from the lint pass to match what
`moc` already sees during `mops check`. Without this, projects with
hundreds of frozen migrations couldn't get fast lint feedback even
with `check-limit = 1`. Explicit filters (`mops lint <name>`) and
explicit file paths bypass the trim so users can lint a trimmed
migration on demand.

Made-with: Cursor
Extract `resolveMigrationChain` from `prepareMigrationArgs`. It validates
config, discovers files, and applies `*-limit` once, returning both the
post-trim entries to stage for moc and the absolute paths excluded from
lint. Eliminates the duplicated `chainFiles.length - limit + (hasNext ? 1 : 0)`
formula in `getTrimmedMigrationFiles` — the trim semantics now live in
exactly one place. `prepareMigrationArgs` consumes `included` directly,
avoiding the split-then-merge that made the prior abstraction attempt
worse than what it replaced.

No behavior change: all migrate / check / build snapshot tests pass
byte-for-byte.

Made-with: Cursor
@Kamirus Kamirus marked this pull request as ready for review April 29, 2026 13:02
@Kamirus Kamirus requested a review from a team as a code owner April 29, 2026 13:02
@Kamirus Kamirus merged commit 2cdb2a5 into main Apr 29, 2026
34 of 36 checks passed
@Kamirus Kamirus deleted the feat/lint-trim-migrations branch April 29, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant