feat: add linting, formatting, and dependency validation CI#93
feat: add linting, formatting, and dependency validation CI#93dignifiedquire wants to merge 4 commits intomainfrom
Conversation
- Add .github/workflows/ci.yml with parallel Rust and Python jobs - Rust: cargo fmt --check, cargo clippy, cargo check - Python: uv pip install, ruff check, ruff format --check - Add ruff.toml with conservative lint rules (F, E) - Add netsim/pyproject.toml with project dependencies - Switch netsim python_deps.sh from pip3 to uv - Fix clippy warnings in chuck/src/ (redundant guard, unused io, etc.) - Fix ruff lint violations in netsim/ (unused imports, f-strings, not-in) - Auto-format netsim/ Python files with ruff - Update netsim README with uv-based setup instructions
There was a problem hiding this comment.
i'm not (yet) able to review if these new instructions make sense
| @@ -0,0 +1,14 @@ | |||
| target-version = "py38" | |||
| src = ["netsim"] | |||
There was a problem hiding this comment.
also "parsing", "net" and "sniffer"? strangely you seem to have fixed up files in those directories in this PR.
|
but yay! netsim runs again with this! |
- Switch from rust-cache to sccache (matching iroh CI setup) - Install Python deps into venv instead of system Python - Add mininet to pyproject.toml dependencies - Add parsing, net, sniffer directories to ruff.toml src
| name: Rust lint & check | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| RUSTC_WRAPPER: "sccache" |
There was a problem hiding this comment.
I think you also need the SCCACHE_GHA_ENABLED: "on" bit when using hosted runners (which this is)
ruff.toml
Outdated
| @@ -0,0 +1,14 @@ | |||
| target-version = "py38" | |||
| src = ["netsim", "netsim/parsing", "netsim/net", "netsim/sniffer"] | |||
There was a problem hiding this comment.
oh, now that you write netsim/parsing i understand why this works! I didn't notice this is in the parent directory. given pyproject.toml is in the netsim directory I was not expecting this to be used outside of it. I thought that effectively made it the project root.
But now it seems wrong to explicitly list the others if it stays in this location... sorry!
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
i think this may need a merge from main now that sims have been deleted? |
Adds a lightweight CI workflow for code quality checks:
Rust (parallel job on ubuntu-latest):
cargo fmt --checkcargo clippy --all-targetscargo checkPython (parallel job on ubuntu-latest):
uv pip install— validates dependency resolutionruff check netsim/ruff format --check netsim/Also includes:
ruff.tomlwith conservative lint rulesnetsim/pyproject.tomlwith project dependenciespip3touvfor Python dep management