One binary for CS50; check, style, and submit.
Features • Quick start • Usage • Exit codes • Development • Roadmap
µ50 unifies Harvard CS50's three command-line tools (check50, style50, and submit50) into a single Rust binary. The style engine is fully implemented and verified byte-identical against style50 3.0.0; check and submit are on the roadmap.
- Self-provisioning — missing formatter backends are downloaded and cached on first use. No system
python3,pip, oruvrequired. - 8 languages — C, C++, Java, Python, JavaScript, HTML, CSS, SQL: the full style50 3.0.0 language set.
- Cache-only resolution — tools are resolved strictly from µ50's own cache; nothing on your
PATHcan shadow or hijack them. - In-place fix —
--fixrewrites files with style50 formatting;--dry-runpreviews what would change. - Five output modes — character (default), split, unified, JSON for tooling, and score for grading (style50-compatible aggregate, e.g.
0.85). - Reproducible — backend versions are pinned, and CI verifies output byte-identical to the original tool.
Note
There is nothing to install besides Rust. The first u50 style run provisions
exactly the backends it needs into µ50's cache — ~/.cache/u50/style50 on
Unix, %LOCALAPPDATA%\u50\style50 on Windows — a managed venv built
in-process via uv's library crates.
git clone https://github.com/HoppouDev/u50 && cd u50
cargo build# Check style (auto-provisions any missing backend on first use)
u50 style src/
u50 style -o unified hello.c
u50 style -o json src/ > report.json
# Fix in place (preview first)
u50 style --fix --dry-run src/
u50 style --fix src/
# Pre-download all six backends up front (CI, offline use)
u50 --setup
# Show what's installed, per language
u50 --statusExample output (-o unified):
- int main(){printf("hello\n");return 0;}
+ int main(void)
+ {
+ printf("hello\n");
+ return 0;
+ }| Code | Meaning |
|---|---|
| 0 | Clean (no violations, fix succeeded) |
| 1 | Violations found / dry run reported would-fix |
| 2 | Usage error |
| 3 | Per-file or infrastructure error (unreadable file, unsupported extension, missing or failing formatter, provisioning failure) |
cargo build
cargo test
U50_STYLE_GOLDEN=1 cargo test -p u50_style --test golden # golden fixtures vs. style50 3.0.0
cargo clippy --workspace --all-targets -- -Dwarnings # zero warnings (pedantic)
cargo fmt --all -- --checkCI (GitHub Actions, workflow name Rust) runs on every push/PR to main: build, tests, format check, and clippy on both ubuntu-latest and windows-latest; the golden suite and the harness-score ratchet (dedicated job) run on ubuntu runners only (Windows byte-drift in the djhtml/sql backends).
u50 style — u50_style
- Style checking for all 8 style50 3.0.0 languages (C, C++, Java, Python, JavaScript, HTML, CSS, SQL), verified byte-identical against the original
- Self-provisioning backends via uv library crates (managed CPython, venv, pinned wheels)
- Cache-only tool resolution (system
PATHnever consulted) - In-place fix (
--fix) with dry-run preview - Output modes:
character,split,unified,json,score -
--ignore— exclude directories (e.g.node_modules) from directory walks -
--clang-format-style— custom clang-format style override -
htmloutput mode (style50 v2 feature) - Comment-count hints ("But consider adding more comments!")
- Windows support (uv console-script
.exeshims,%LOCALAPPDATA%cache)
u50 check — u50_check
- check50 reimplementation: online, local, offline, and dev modes
- check results rendering (ANSI / HTML / JSON)
u50 submit — u50_submit
- submit50 reimplementation: GitHub submission via git (
git2with SSH) -
--yes/--dry-run/--logoutsubmit flags
The binary entry point lives in u50_cli.
AGENTS.md— repository conventions for humans and agents (start here)- Per-crate docs:
u50_cli/AGENTS.md·u50_style/AGENTS.md·u50_check/AGENTS.md·u50_submit/AGENTS.md