Add linting and checking into the repo#7
Merged
jacomago merged 6 commits intoFeb 24, 2026
Conversation
Fix all warnings surfaced by `cargo clippy --workspace --all-targets`:
- reccaster: `props: props` → shorthand, `{ return; }` → `{}` on
WouldBlock, `while let` → `if let` (never_loop), three `recid: recid`
→ shorthand, `if let Err(_) =` → `.is_err()`, trailing `return`
- pyreccaster: `Python` → `Python<'_>` (mismatched-lifetime-syntaxes)
- basic-reccaster: remove bare `use tracing_subscriber` (single-component-path-imports)
https://claude.ai/code/session_01V61zGHMt1gkkK8pjTLUxT2
Add [workspace.lints] to the root Cargo.toml so lint levels are
declared once and enforced consistently across local builds, clippy
runs, and CI — no CLI flags required:
[workspace.lints.rust]
missing_docs = "deny"
[workspace.lints.clippy]
all = { level = "deny", priority = -1 }
Each member crate opts in with `[lints] workspace = true`.
Note: clippy.toml configures lint *behaviours* (thresholds, etc.);
[workspace.lints] is the correct mechanism for lint *levels*.
https://claude.ai/code/session_01V61zGHMt1gkkK8pjTLUxT2
Document all public items in the wire and reccaster crates: - wire: crate-level doc, all structs/enums/variants/methods - reccaster: crate-level doc, Reccaster struct, new/run methods, pub mod record - reccaster::record: Record struct, fields, and Record::new Suppress missing_docs for the pyreccaster FFI crate and the basic-reccaster example binary with #![allow(missing_docs)], as documenting internal bindings and example code provides little value. https://claude.ai/code/session_01V61zGHMt1gkkK8pjTLUxT2
Run `cargo fmt --all` across the workspace. Key reformatting: - wire/src/codec.rs: wrap long encode/decode match arms - reccaster/src/lib.rs: reflow long struct-literal lines and match arms - pyreccaster/src/lib.rs: reflow long lines in impl blocks - Remaining files: trailing whitespace and minor alignment fixes https://claude.ai/code/session_01V61zGHMt1gkkK8pjTLUxT2
ecb5c04 to
1b0cd4d
Compare
Configure ruff (linter) and mypy (type checker) in pyreccaster/pyproject.toml: - ruff: line-length 120, select E/F/I, ignore E501 on long literal lines - mypy: strict mode enabled Fix violations surfaced by those tools: - test_all.py: add missing imports, fix bare `except`, remove unused vars - __init__.py: add explicit re-export to satisfy mypy's implicit-reexport rule https://claude.ai/code/session_01V61zGHMt1gkkK8pjTLUxT2
Add .pre-commit-config.yaml that runs on every commit: - trailing-whitespace, end-of-file-fixer, check-yaml (pre-commit-hooks) - ruff (lint) and ruff-format for Python - mypy for Python type checking - cargo fmt --check (formatting gate) - cargo clippy --workspace --all-targets (lint gate) Simplify .github/workflows/rust.yml: replace separate fmt/clippy/build jobs with a single pre-commit job (runs the same hooks as locally) plus a dedicated test job, ensuring local and CI checks stay in sync. Also fix trailing whitespace in README.md and .gitlab-ci.yml, detected by the new trailing-whitespace hook. https://claude.ai/code/session_01V61zGHMt1gkkK8pjTLUxT2
1b0cd4d to
56f6ca2
Compare
aqshafei
approved these changes
Feb 24, 2026
| exclude = ["test.py"] | ||
|
|
||
| [tool.ruff.lint] | ||
| select = ["E", "F", "I", "UP", "B", "RUF"] |
Contributor
There was a problem hiding this comment.
I am not sure about adding UP (pyupgrde) option here
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.
This adds cargo clippy and ruff checking to the pre-commit and check it in ci.