Skip to content

feat: add linting, formatting, and dependency validation CI#93

Open
dignifiedquire wants to merge 4 commits intomainfrom
ci-checks
Open

feat: add linting, formatting, and dependency validation CI#93
dignifiedquire wants to merge 4 commits intomainfrom
ci-checks

Conversation

@dignifiedquire
Copy link
Contributor

Adds a lightweight CI workflow for code quality checks:

Rust (parallel job on ubuntu-latest):

  • cargo fmt --check
  • cargo clippy --all-targets
  • cargo check

Python (parallel job on ubuntu-latest):

  • uv pip install — validates dependency resolution
  • ruff check netsim/
  • ruff format --check netsim/

Also includes:

  • ruff.toml with conservative lint rules
  • netsim/pyproject.toml with project dependencies
  • Switch from pip3 to uv for Python dep management
  • Clippy and ruff fixes across the codebase
  • Updated netsim README with uv-based setup instructions

- 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
@n0bot n0bot bot added this to iroh Feb 17, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Feb 17, 2026
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not (yet) able to review if these new instructions make sense

@@ -0,0 +1,14 @@
target-version = "py38"
src = ["netsim"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also "parsing", "net" and "sniffer"? strangely you seem to have fixed up files in those directories in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@flub
Copy link
Contributor

flub commented Feb 17, 2026

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
- actions/checkout: @master/@v4 -> @v6
- actions/setup-python: @v5 -> @v6
- astral-sh/setup-uv: @v5 -> @v7
- actions-rs/toolchain@v1 -> dtolnay/rust-toolchain@stable (archived)
- peter-evans/create-or-update-comment: @v2 -> @v5
name: Rust lint & check
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also need the SCCACHE_GHA_ENABLED: "on" bit when using hosted runners (which this is)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

ruff.toml Outdated
@@ -0,0 +1,14 @@
target-version = "py38"
src = ["netsim", "netsim/parsing", "netsim/net", "netsim/sniffer"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@github-project-automation github-project-automation bot moved this from 🚑 Needs Triage to 🏗 In progress in iroh Feb 17, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@flub
Copy link
Contributor

flub commented Feb 23, 2026

i think this may need a merge from main now that sims have been deleted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants