Skip to content

Fix Ruff ISC004 string concatenations - #471

Merged
cclauss merged 2 commits into
cpplint:developfrom
PNHD:fix/ruff-0.16-isc004
Sep 2, 2026
Merged

cclauss merged 2 commits into
cpplint:developfrom
PNHD:fix/ruff-0.16-isc004

Conversation

@PNHD

@PNHD PNHD commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #460, where @cclauss asked for a separate PR fixing the 12 issues exposed by Ruff 0.16.1.

This fixes the code and, per maintainer follow-up, upgrades the pre-commit Ruff hook to v0.16.1 so the PR tests the newly enforced rule itself:

  • parenthesize 11 intentional implicit string concatenations in collection entries
  • add the missing comma in testElseOnSameLineAsClosingBraces, where the empty string is intended to be a separate source line rather than concatenated with " else {"
  • update astral-sh/ruff-pre-commit from v0.15.20 to v0.16.1

Validation before the hook bump:

  • uvx ruff==0.16.1 check cpplint_unittest.py --select ISC004
  • uvx ruff==0.16.1 check .
  • Ruff 0.15.20 check + format check
  • full pytest: 231 passed in an isolated temporary directory outside any parent Git checkout

The updated pre-commit configuration now lets CI validate the same Ruff 0.16.1 behavior directly.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 298b725c-bb60-41b7-acd5-35f2bf8b5aa9

📥 Commits

Reviewing files that changed from the base of the PR and between 0333563 and ce5d121.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The change reformats multiline test strings and adds one trailing comma in cpplint_unittest.py. It also updates the ruff-pre-commit revision from v0.15.20 to v0.16.1. Test values and assertions remain unchanged.

Changes

Test Formatting Updates

Layer / File(s) Summary
Format multiline test literals
cpplint_unittest.py
Multiline diagnostic and input strings are wrapped in parentheses. One test input list element receives a trailing comma. Test values and assertions remain unchanged.
Update Ruff pre-commit revision
.pre-commit-config.yaml
The ruff-pre-commit revision changes from v0.15.20 to v0.16.1. The existing ruff-check and ruff-format hooks remain configured.

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

Merge Risk: ⚪ Minimal · up to ce5d1

This PR makes localized test-source formatting and string-separation fixes without changing production behavior or dependencies; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: cclauss

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing Ruff ISC004 string-concatenation issues. It is concise and specific.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@cclauss

cclauss commented Sep 2, 2026

Copy link
Copy Markdown
Member

Nice! Please upgrade ruff in .pre-commit-config.yaml so the pull request tests itself.

@PNHD

PNHD commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Done - I updated ruff-pre-commit to v0.16.1 in ce5d121 so the PR tests the new ISC004 behavior directly. The updated GitHub Actions matrix is green. Thanks for the follow-up.

@cclauss
cclauss merged commit 92fa4db into cpplint:develop Sep 2, 2026
6 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