diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a1af02b..f0b9354 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -52,4 +52,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: swatinem/rust-cache@v2 - - run: cargo check --all-targets + - name: Check formatting + run: cargo fmt --all -- --check + - name: Check compilation + run: cargo check --all-targets diff --git a/TODO.md b/TODO.md index 4b781b3..c7c8e3e 100644 --- a/TODO.md +++ b/TODO.md @@ -8,6 +8,7 @@ Snapshot: 2026-07-28. ### What works +- `cargo fmt --all -- --check` passes and is enforced for pull requests. - `cargo check --all-targets` passes. - All 47 integration specifications in `tests/language_specs.rs` pass. - The crate exposes checked file/source execution APIs and typed I/O, parse, and runtime error categories. @@ -16,7 +17,6 @@ Snapshot: 2026-07-28. ### Quality gaps - `cargo test` fails because the library doctest uses invalid syntax and nonexistent `Value::Integer`. -- `cargo fmt --all -- --check` reports an import-order difference in `src/errors.rs`. - Strict Clippy reports 36 errors across the interpreter, lexer, parser, type inference, and symbol table. - Panic recovery wraps rather than removes many panic, `unwrap`, and `expect` paths; the interpreter alone contains roughly 90. - `parser.rs` and `interpreter.rs` are approximately 975 and 1,217 lines and mix several responsibilities. @@ -70,7 +70,7 @@ Snapshot: 2026-07-28. ## Phase 1 — Clean Legacy Baselines -- [ ] Open and complete an issue that applies rustfmt, adds `cargo fmt --all -- --check` to CI, and changes no behavior. +- [x] Open and complete an issue that applies rustfmt, adds `cargo fmt --all -- --check` to CI, and changes no behavior. - [ ] Fix the library doctest against the v0.1 API, make `cargo test` green, and require it in CI. - [ ] Resolve strict Clippy findings without suppressing project-wide lints, then require `-D warnings` in CI. - [ ] Separate generated mdBook output from sources and define one reproducible documentation build command. diff --git a/src/errors.rs b/src/errors.rs index ba6f2a7..193bd61 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,7 +1,7 @@ +use std::cell::Cell; use std::error::Error; use std::fmt; -use std::cell::Cell; -use std::panic::{catch_unwind, set_hook, take_hook, UnwindSafe}; +use std::panic::{UnwindSafe, catch_unwind, set_hook, take_hook}; use std::sync::{Mutex, OnceLock}; #[derive(Debug, Clone, PartialEq, Eq)]