Skip to content

Add ruff lint to the test workflow - #31

Open
Nicolas Palpacuer (NickPPC) wants to merge 4 commits into
mainfrom
add-ruff-lint
Open

Nicolas Palpacuer (NickPPC) wants to merge 4 commits into
mainfrom
add-ruff-lint

Conversation

@NickPPC

Copy link
Copy Markdown

Summary

Add a lint job running ruff check and ruff format --check to the existing Build & Test workflow, which already compiles, imports and builds the binary on every PR and push to main. The existing check and build jobs are unchanged.

Changes

  • New lint job in test.yml: ruff check + ruff format --check via astral-sh/ruff-action pinned by SHA to v4.1.0, ruff 0.17.0
  • ruff.toml restricts lint to pyflakes, pycodestyle errors and import sorting, with line-length = 120 (formatting diff 75+/32- vs 153+/44- at the default 88)
  • ruff format commit: 3 files, whitespace and quotes only
  • Import commit: sorted imports, dropped 2 unused imports (time, odrive in utils.py); the OdriveSerial import in main.py is kept with # noqa: F401 because it registers the model
  • from odrive.enums import * replaced with the 4 enums used (AxisState, ControlMode, InputMode, ODriveError; checked against the odrive 0.6.10.post0 wheel), plus one placeholder-less f-string
  • No overlap with martha/pr-tests: that branch is the one merged as Add test.yml workflow #25, which added test.yml; nothing else is in flight
  • Follow-up: the repo has no pytest suite, so no test step was added

Testing

  • Locally: ruff check and format are clean at 0.17.0, and every local import in src resolves.
  • The check, build and lint jobs on this PR verify the deps still import and the binary still builds after the import changes.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lists the four enums the motor uses so ruff can check undefined names
(F403/F405), and drops a placeholder-less f-string (F541).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NickPPC
Nicolas Palpacuer (NickPPC) requested a review from a team October 26, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant