Skip to content

fix: make the known-benign message concatenation explicit (ISC004) - #3

Merged
t0kubetsu merged 2 commits into
mainfrom
fix/isc004-implicit-concat
Aug 12, 2026
Merged

fix: make the known-benign message concatenation explicit (ISC004)#3
t0kubetsu merged 2 commits into
mainfrom
fix/isc004-implicit-concat

Conversation

@t0kubetsu

Copy link
Copy Markdown
Contributor

What

Wraps an implicitly concatenated string in explicit parentheses, and adds ISC to the ruff select list.

Why

determine_verdict() built its known-benign message from two adjacent string literals inside the returned tuple:

return (
    VerdictSeverity.INFO,
    f"Known benign file (hashlookup trust {triage.trust}) — "
    "deep analysis not required",
)

The value produced is correct. The problem is that this is the exact construct where a single missing comma silently merges two tuple elements into one string rather than raising — and a reader cannot distinguish a deliberate two-line string from that typo. Surfaced by ISC004 when the new CI ran against current ruff.

The rule, not just the instance

The CI configuration merged last week pins select = ["E4", "E7", "E9", "F"], which does not include ISC — so fixing only the call site would leave the pattern free to reappear with nothing to catch it. ISC is now selected, with a comment recording why it is beyond the default set.

Verified

ruff check fileanalyzer/ tests/ clean, 88 tests passing. No behaviour change — same tuple, same string value.

The message was assembled by implicit string concatenation inside the
returned tuple. The produced value was correct, but this is precisely
the construct where one missing comma merges two tuple elements into a
single string silently, rather than failing — so the reader cannot tell
a deliberate two-line string from a typo.

Wrapped in explicit parentheses, and ISC added to the ruff select list
so the pattern stays caught instead of being fixed once and regressing.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@t0kubetsu, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c60d87d3-66e0-436c-a3aa-2ac183e1ddd3

📥 Commits

Reviewing files that changed from the base of the PR and between 49d8a7e and ebe85d4.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • fileanalyzer/verdict.py
  • pyproject.toml

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

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

The PR preserves determine_verdict() behavior while making its known-benign string concatenation unambiguous.

  • Wraps the adjacent string literals in explicit parentheses.
  • Enables Ruff’s ISC rule family to prevent regression.
  • Documents both changes under the unreleased changelog.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The code change preserves the same tuple and string value, the lint configuration targets the intended pattern, and no concrete newly introduced lint or repository-rule violation was established.

Important Files Changed

Filename Overview
fileanalyzer/verdict.py Makes an existing string concatenation explicit without changing the returned tuple or message.
pyproject.toml Adds the ISC lint family and documents why it is intentionally enabled.
CHANGELOG.md Accurately records the behavior-preserving cleanup and lint configuration change.

Reviews (1): Last reviewed commit: "fix: make the known-benign message conca..." | Re-trigger Greptile

PR #4 (canonical SPDX license expression) landed while this branch was
open. pyproject.toml auto-merged cleanly -- their license/build-requires
change and this branch's ruff ISC selection touch different keys.

CHANGELOG.md conflicted because #4 opened a released [0.2.1] section
where this branch had added [Unreleased] entries. Resolved by keeping
both in their proper places: the ISC004 fix stays unreleased, [0.2.1]
follows as the shipped section.

@greptile-apps greptile-apps 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.

t0kubetsu has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@t0kubetsu
t0kubetsu merged commit 42e0194 into main Aug 12, 2026
4 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.

1 participant