Skip to content

Add ruff format linter and fix current codebase#120

Merged
scal444 merged 2 commits intoNVIDIA-Digital-Bio:mainfrom
scal444:ruff_fix
Mar 30, 2026
Merged

Add ruff format linter and fix current codebase#120
scal444 merged 2 commits intoNVIDIA-Digital-Bio:mainfrom
scal444:ruff_fix

Conversation

@scal444
Copy link
Copy Markdown
Collaborator

@scal444 scal444 commented Mar 25, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 25, 2026

Greptile Summary

This PR introduces ruff format as a new automated formatter for the Python codebase, adding a CI workflow job and a helper shell script, and then applies the formatter's output across all 15 changed Python files. The pyproject.toml include list is simultaneously widened to cover all of nvmolkit, benchmarks, and setup.py, so the new CI gate enforces consistent formatting going forward.

  • All Python changes are purely cosmetic — single quotes → double quotes, blank lines between top-level definitions, long lines wrapped with parentheses, and alignment-style spaces removed. No logic, control flow, or API surface was altered.
  • admin/run_ruff_format.sh checks that ruff is installed, warns (but does not fail) on version mismatch, and accepts -d for dry-run mode via --check; this mirrors the pattern of the existing run_cmake_format_lint.sh.
  • CI job pins ruff to 0.15.8 and runs the dry-run script; the job structure is consistent with the other lint jobs already in lint.yml.
  • pyproject.toml scope expansion is coherent with the files touched in this PR — nothing is left out that was reformatted, and nothing extra is included beyond what is reasonable for a library of this size.

Confidence Score: 5/5

Safe to merge — all changes are pure formatting with no semantic or logic modifications.

Every Python file change is a mechanical ruff format output (quote style, whitespace, line wrapping). The new CI job and script are well-structured and consistent with existing tooling. No P0 or P1 findings were identified.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/lint.yml Adds new ruff-format CI job that installs ruff 0.15.8 and runs the format check in dry-run mode; straightforward and consistent with the existing lint job pattern.
admin/run_ruff_format.sh New shell script that validates the installed ruff version, accepts a -d flag for dry-run (--check) mode, and runs ruff format over the repo root; well-structured and consistent with sibling scripts.
pyproject.toml Expands ruff's include list from just nvmolkit/tests/conftest.py to all Python files in nvmolkit, benchmarks, and setup.py, aligning the linter scope with the files actually reformatted in this PR.
nvmolkit/similarity.py Pure formatting changes: function signatures reformatted to one parameter per line, long ternary expressions wrapped in parentheses, blank lines added between top-level definitions; no logic changes.
nvmolkit/tests/test_substructure.py Large formatting-only pass: blank lines added before class definitions, trailing whitespace removed from docstrings, multi-line assert messages reformatted, alignment-style spaces removed from list literals.

Reviews (2): Last reviewed commit: "Ruff version pin and chekc" | Re-trigger Greptile

@scal444 scal444 requested a review from evasnow1992 March 30, 2026 14:45
@scal444 scal444 changed the title [draft] Add ruff format linter and fix current codebase Add ruff format linter and fix current codebase Mar 30, 2026
Copy link
Copy Markdown
Collaborator

@evasnow1992 evasnow1992 left a comment

Choose a reason for hiding this comment

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

Changes look good to me. Thank you!

@scal444 scal444 merged commit 2772b21 into NVIDIA-Digital-Bio:main Mar 30, 2026
8 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.

2 participants