Skip to content

CI: lint with mojolint - #7

Merged
winding-lines merged 1 commit into
mainfrom
ci-lint
Sep 4, 2026
Merged

winding-lines merged 1 commit into
mainfrom
ci-lint

Conversation

@winding-lines

Copy link
Copy Markdown
Contributor

Adds lint-mojo 0.1.1 as a pixi source dependency (pinned at the revision mojoshelf published — what pixi shelf add lint-mojo writes) 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 src alone is enough: threads-mojo installs threads.mojopkg into the environment's lib/mojo, which mojolint (like mojo 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, mirrors tests/check.sh's style) — asserts the flip side: mojolint --lsp -I src tests/uncaught must 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 lint on purpose (all deliberate, not oversights):

  • src/post.mojo — the uncorrected listing, a deliberate positive.
  • tests/uncaught/*.mojo — deliberate positives, checked instead by lint-uncaught.
  • tests/caught/*.mojo — already deliberately rejected by the compiler (tests/check.sh builds them and expects failure); they never reach mojolint.

Verified locally in the default env: pixi run lint exits 0 with no findings (~4s). pixi run lint-uncaught exits 0 (its own pass/fail logic), reporting all four uncaught files flagged by name. pixi run run, run-post, and check still pass — the new dependency didn't disturb the env.

🤖 Generated with Claude Code

https://claude.ai/code/session_015or6oTZmb7EQTXTbALbBXY

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
@winding-lines
winding-lines merged commit 8d683f9 into main Sep 4, 2026
2 checks passed
@winding-lines
winding-lines deleted the ci-lint branch September 4, 2026 00:05
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