镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Feature/ruff fix - #17

Open
alexvalentine94 wants to merge 4 commits into
ukaea:devfrom
alexvalentine94:feature/ruff_fix
Open

alexvalentine94 wants to merge 4 commits into
ukaea:devfrom
alexvalentine94:feature/ruff_fix

Conversation

@alexvalentine94

Copy link
Copy Markdown
Collaborator

Ruff fixes and formatting

Merge with "Create a merge commit" (not squash or rebase) so the formatting commit hash listed in .git-blame-ignore-revs stays valid.

Commits

  1. ruff check --fix: 891 safe fixes across 64 files (unused imports, import sorting, modern type annotations, f-strings without placeholders, redundant pass, etc.)
    • Fixes a circular import exposed by import sorting: decomposemultiprocess now imports DecompositionSolid from decomposesolid, where it is defined, rather than from decompose
  2. ruff format: 75 files reformatted, layout only. Every file parses to the same code as before.
  3. .git-blame-ignore-revs: lists the format commit so git blame and GitHub's blame view skip it. Locally: git config blame.ignoreRevsFile .git-blame-ignore-revs

Results

  • Ruff score: 7.83 → 9.40/10 (1,207 → 316 findings)
  • Tests unchanged (352 passed, 16 skipped without OpenMC); blocking lint passes
  • All 50 mcio modules import; examples and CLI run; MCNP decks from the examples are identical apart from timestamps
  • Removed imports checked by hand: side-effect imports (casadi, OCP, optional openmc/cadquery) kept, and no module relied on a removed name

Remaining findings (need manual review)

316 findings that aren't auto-fixable, including mutable default arguments (B006), loop-variable closures (B023), bare/blanket except (E722, BLE001) and unused variables (F841).

Reviewing

Review commit 1 for code changes; commit 2 is formatting only (git diff -w shows nothing beyond quotes and line wrapping).

This branch has not been deployed

No deployments
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