Skip to content

Repository files navigation

µ50 logo

µ50

One binary for CS50; check, style, and submit.

CI Harness Score License: GPLv3

FeaturesQuick startUsageExit codesDevelopmentRoadmap

µ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.

Features

  • Self-provisioning — missing formatter backends are downloaded and cached on first use. No system python3, pip, or uv required.
  • 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 PATH can shadow or hijack them.
  • In-place fix--fix rewrites files with style50 formatting; --dry-run previews 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.

Quick start

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

Usage

# 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 --status

Example output (-o unified):

- int main(){printf("hello\n");return 0;}
+ int main(void)
+ {
+     printf("hello\n");
+     return 0;
+ }

Exit codes

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)

Development

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 -- --check

CI (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).

Roadmap

u50 styleu50_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 PATH never 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
  • html output mode (style50 v2 feature)
  • Comment-count hints ("But consider adding more comments!")
  • Windows support (uv console-script .exe shims, %LOCALAPPDATA% cache)

u50 checku50_check

  • check50 reimplementation: online, local, offline, and dev modes
  • check results rendering (ANSI / HTML / JSON)

u50 submitu50_submit

  • submit50 reimplementation: GitHub submission via git (git2 with SSH)
  • --yes / --dry-run / --logout submit flags

The binary entry point lives in u50_cli.

Documentation

About

A cs50 command-line utility for checking code correctness, grading code style and submitting projects all in one binary.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages