Skip to content

fix: Resolve lint errors from newer ruff releases - #199

Merged
aronwalsh merged 1 commit into
mainfrom
fix/ruff-016-lint
Aug 9, 2026
Merged

aronwalsh merged 1 commit into
mainfrom
fix/ruff-016-lint

Conversation

@aronwalsh

@aronwalsh aronwalsh commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

The qa job currently fails on every PR (e.g. #198) with 26 ruff errors. Ruff is unpinned (ruff>=0.15.21), so CI resolves the latest release each run, and recent ruff releases stabilised two rules that flag existing code:

  • ISC004 (24 errors): implicit string concatenations inside the CITATIONS lists in utils/config.py. Fixed by parenthesising them (ruff auto-fix). The string values are byte-for-byte unchanged — verified by hashing CITATIONS before and after.
  • PLR0917 "too many positional arguments" (2 errors in plotter.py): added to the ignore list, consistent with the other PLR09xx complexity rules (PLR0911/0912/0913/0915) already ignored.

Testing

  • ruff check passes on both ruff 0.16.2 (what CI resolves today) and the locked 0.15.x
  • prek run --all-files passes (all qa hooks)
  • CITATIONS sha256 identical before/after

Unblocks #198.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Improved the formatting and readability of citation information without changing its content.
  • Chores

    • Updated code quality configuration to better accommodate existing project patterns.
    • No user-facing functionality or public interfaces were changed.

Ruff is unpinned in CI, and recent releases stabilised two rules that
flag existing code, failing the qa job on every PR:

- ISC004: parenthesise implicit string concatenations in the CITATIONS
  lists (auto-fix; string values are byte-for-byte unchanged)
- PLR0917: add to the ignore list alongside the other PLR09xx
  complexity rules already ignored
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds Ruff rule PLR0917 to the ignore list and reformats citation string literals without changing their content or dictionary mappings.

Changes

Lint configuration

Layer / File(s) Summary
Ruff ignore update
pyproject.toml
Adds PLR0917 to the ignored Ruff rules.

Citation formatting

Layer / File(s) Summary
Citation literal formatting
src/elementembeddings/utils/config.py
Reformats CITATIONS entries with parenthesized multiline literals and updated indentation. Citation values and mappings remain unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: antobi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: fixing lint errors caused by newer Ruff releases.
Description check ✅ Passed The description explains the cause, changes, validation steps, compatibility checks, and issue impact, although it omits several template sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ruff-016-lint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pyproject.toml (1)

131-131: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope PLR0917 to plotter.py.

Line 131 adds a project-wide ignore, but the PR objective identifies only two violations in plotter.py. This can hide future violations in unrelated files. Use Ruff’s per-file ignore for plotter.py, or confirm that global suppression is intentional.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` at line 131, Replace the project-wide PLR0917 ignore in the
Ruff configuration with a per-file ignore scoped to plotter.py, preserving
suppression only for that file and avoiding masking violations elsewhere.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pyproject.toml`:
- Line 131: Replace the project-wide PLR0917 ignore in the Ruff configuration
with a per-file ignore scoped to plotter.py, preserving suppression only for
that file and avoiding masking violations elsewhere.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 37fd4c29-a477-4314-ac19-a742818da3f2

📥 Commits

Reviewing files that changed from the base of the PR and between 68aba04 and 99fcab7.

📒 Files selected for processing (2)
  • pyproject.toml
  • src/elementembeddings/utils/config.py

@aronwalsh
aronwalsh merged commit 0308672 into main Aug 9, 2026
15 checks passed
@aronwalsh
aronwalsh deleted the fix/ruff-016-lint branch August 9, 2026 14:17
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