Skip to content

ci: add ruff linting to CI and fix mechanical violations - #5

Merged
oager merged 1 commit into
oager:mainfrom
KIRA-L001:fix/issue-2
Aug 17, 2026
Merged

oager merged 1 commit into
oager:mainfrom
KIRA-L001:fix/issue-2

Conversation

@KIRA-L001

Copy link
Copy Markdown
Contributor

Closes #2.

Adds ruff as configured in the issue, wired into CI alongside pytest.

  • pyproject.toml: [tool.ruff] with line-length = 100, target-version = "py311"; lint select limited to a mechanical, low-risk rule set (E4/E7/E9, F, I, UP); ruff>=0.8 added to the dev extra; per-file ignore of E402 for scripts/* (they insert the repo root into sys.path before importing wfa.*).
  • .github/workflows/tests.yml: ruff check . step before pytest.
  • Mechanical cleanup of the existing violations surfaced by the first run (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 ambiguous l variable in a test comprehension (E741). No formulas or behavior in wfa/objectives.py, metrics.py, or survival.py were 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

)

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>
@oager
oager merged commit 2046b0c into oager:main Aug 17, 2026
2 checks passed
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.

Add ruff linting to CI

2 participants