Add mojo format to lint pipeline; parallelize update_challenges.py uploads#239
Merged
kunal-mansukhani merged 1 commit intomainfrom Apr 5, 2026
Merged
Conversation
Wires mojo format into the lint pipeline and applies it repo-wide (78 starter files reformatted). Also parallelizes the HTTP uploads in scripts/update_challenges.py so deploys fan out instead of running serially. - .pre-commit-config.yaml: local mojo-format hook running `mojo format -q` - .github/workflows/lint.yml: lint-mojo job now installs `modular` via pip and enforces formatting via `mojo format` + `git diff --exit-code` - .github/workflows/create-challenge.yml: adds `modular` to the cron's pip install so Claude's `pre-commit run --all-files` step has `mojo` on PATH - pyproject.toml: drop `target-version = ['py312']` from [tool.black] — mblack (which `mojo format` wraps) reads the same section and rejects any target above py311; black auto-detects target fine without it - scripts/update_challenges.py: upload via ThreadPoolExecutor(max_workers=16). Loading stays sequential because importlib with a shared "challenge" module name and sys.path mutation is not thread-safe. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
0942f74 to
29f72d5
Compare
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.
Summary
mojo formatinto pre-commit and thelint-mojoCI job, and reformats all 78 existing.mojostarter files so the check goes green.modular(provides themojobinary) to the challenge-creation cron's pip install, so Claude'spre-commit run --all-filesstep won't fail on missingmojo.target-version = ['py312']from[tool.black]inpyproject.toml:mojo formatwrapsmblack, which reads the same[tool.black]section but only accepts targets up topy311(ormojo). Black auto-detects the target fine without it.scripts/update_challenges.py: HTTP uploads now fan out viaThreadPoolExecutor(max_workers=16). Loading stays sequential becauseimportlibreuses a"challenge"module name and mutatessys.path, which isn't thread-safe.Test plan
pre-commit run --all-files— all hooks pass locally (black, isort, flake8, clang-format, mojo format, etc.)mojo format -qrun over allchallenges/**/*.mojo;git diff --exit-codeclean afterwardpython -c "import ast; ast.parse(open('scripts/update_challenges.py').read())"parses cleanlylint-mojoCI job installsmodularand the format check passes on this PRupdate_challenges.pystill deploys correctly end-to-end against staging (sanity check that concurrent POSTs don't hit a rate limit —max_workers=16may need tuning)mojonow available on PATH🤖 Generated with Claude Code