Repository navigation
CI: lint with mojolint - #7
Merged
Merged
Conversation
Adds lint-mojo (mojoshelf, pinned) as a source dependency, a `lint` task running `mojolint --lsp ...`, and a CI step on every matrix leg. `lint` covers only src/origins.mojo, the post's corrected listing. src/post.mojo and tests/uncaught/*.mojo are deliberate positives for the linter; a new `lint-uncaught` task (tests/lint_uncaught.sh) asserts mojolint flags every file in tests/uncaught/ instead of silencing them. tests/caught/*.mojo are already deliberately rejected by the compiler and never reach mojolint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015or6oTZmb7EQTXTbALbBXY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds lint-mojo 0.1.1 as a pixi source dependency (pinned at the revision mojoshelf published — what
pixi shelf add lint-mojowrites) and two tasks, both wired into the single CI job (no env matrix here, only an OS matrix) right after the existing "Caught and uncaught" step:lint = { cmd = "mojolint --lsp -I src src/origins.mojo" }— lints only the post's corrected listing.-I srcalone is enough:threads-mojoinstallsthreads.mojopkginto the environment'slib/mojo, whichmojolint(likemojo build) resolves automatically without an extra-I; no sibling checkout of threads.mojo is needed.lint-uncaught = { cmd = "bash tests/lint_uncaught.sh" }(new script, mirrorstests/check.sh's style) — asserts the flip side:mojolint --lsp -I src tests/uncaughtmust exit non-zero and its output must name every file in that directory. Failing to catch one would be a silent regression in what the post's linter claims to catch.Left out of
linton purpose (all deliberate, not oversights):src/post.mojo— the uncorrected listing, a deliberate positive.tests/uncaught/*.mojo— deliberate positives, checked instead bylint-uncaught.tests/caught/*.mojo— already deliberately rejected by the compiler (tests/check.shbuilds them and expects failure); they never reach mojolint.Verified locally in the
defaultenv:pixi run lintexits 0 with no findings (~4s).pixi run lint-uncaughtexits 0 (its own pass/fail logic), reporting all four uncaught files flagged by name.pixi run run,run-post, andcheckstill pass — the new dependency didn't disturb the env.🤖 Generated with Claude Code
https://claude.ai/code/session_015or6oTZmb7EQTXTbALbBXY