Repository navigation
ci: add ruff linting to CI and fix mechanical violations - #5
Merged
Merged
Conversation
) Adds a [tool.ruff] config (line-length 100, py311) with a mechanical rule set (E4/E7/E9, F, I, UP), a ruff check step in the tests workflow, ruff in the dev extra, and fixes the existing mechanical violations. No behavioural changes in objectives/metrics/survival per the issue's scope note. ruff check passes; 227 tests pass. Signed-off-by: KIRA-L001 <137947115+KIRA-L001@users.noreply.github.com>
This was referenced Aug 17, 2026
Closed
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.
Closes #2.
Adds ruff as configured in the issue, wired into CI alongside pytest.
pyproject.toml:[tool.ruff]withline-length = 100,target-version = "py311"; lint select limited to a mechanical, low-risk rule set (E4/E7/E9,F,I,UP);ruff>=0.8added to thedevextra; per-file ignore ofE402forscripts/*(they insert the repo root intosys.pathbefore importingwfa.*)..github/workflows/tests.yml:ruff check .step before pytest.ruff check --fix): unused imports (F401), import sorting (I001),datetime.timezone.utc→datetime.UTC(UP017), deprecated typing imports (UP035), unused noqa (RUF-adjacent under F), plus one manual rename of an ambiguouslvariable in a test comprehension (E741). No formulas or behavior inwfa/objectives.py,metrics.py, orsurvival.pywere changed — only import lines and the UTC alias.Per the scope note, behavioural rules (e.g. BLE001 blind-except, DTZ) are intentionally not enabled; enabling them is left to a follow-up with design judgement.
Verified locally:
ruff check .→ All checks passed!pytest -q→ 227 passed