Skip to content

Tighten comment-stacked-dashes: flag 2+ lines, not just 3+ - #9

Merged
jnasbyupgrade merged 1 commit into
mainfrom
worktree-valiant-doodling-pascal
Aug 12, 2026
Merged

Tighten comment-stacked-dashes: flag 2+ lines, not just 3+#9
jnasbyupgrade merged 1 commit into
mainfrom
worktree-valiant-doodling-pascal

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Summary

  • The comment-stacked-dashes rule previously allowed up to 2 consecutive -- line-comments before requiring a /* */ block; that gap was being used to smuggle multi-line commentary in as back-to-back 2-line runs.
  • Only a single -- line is now permitted on its own; anything with 2+ consecutive lines must use /* */ or carry an explicit sql-lint:disable comment-stacked-dashes exception.
  • Updated fixtures and README to match the new threshold.

Test plan

  • perl sql/test/01-fixtures.t passes (updated comment-stacked-dashes fixtures)
  • perl sql/test/02-scanner.t passes

The 2-line allowance was being used to smuggle in longer -- comments
by splitting them across just-under-the-limit runs. Only a single --
line is now permitted; anything longer must use /* */ or an explicit
sql-lint:disable exception.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e6dd799d-f651-4b3a-9c9b-2194fe5acb48

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 2m 9s —— View job


Claude's Review

  • Gather context (PR diff, changed files, CLAUDE.md)
  • Understand request (code review requested via custom instructions)
  • Review rule logic change in sql/bin/sql-lint
  • Review fixture changes
  • Review README changes
  • Post final review

Verdict: Looks good. This is a small, well-scoped change and the implementation, fixtures, and docs are all consistent with each other.

Logic check (sql/bin/sql-lint:255): the threshold changed from ($end - $start) >= 2 to >= 1. Since $end - $start equals (number of consecutive lines - 1), this correctly moves the trigger from "3+ lines" to "2+ lines," and a single -- line still yields 0, so it stays unflagged. Matches the stated intent exactly.

Fixture check:

  • comment-stacked-dashes.bad.sql: three runs — lines 2‑4 (3 lines), 6‑8 (3 lines), 10‑11 (2 lines) — all now flag, giving expect-findings: 3, which matches the updated count.
  • comment-stacked-dashes.good.sql: correctly drops the old "2 lines is fine" example while keeping the single-line, block-comment, and sql-lint:disable-suppressed multi-line cases intact.

README: the prose and bad/good examples were updated in lockstep with the code and fixtures — no stale "3 or more" references left anywhere else in the repo (checked via grep across sql/).

Minor/no-action nit: the finding message text ("$n consecutive -- comment lines...") still reads fine for n=2, no wording fix needed.

Note: I wasn't able to execute perl sql/test/01-fixtures.t / 02-scanner.t in this sandbox (the tool run required interactive approval I couldn't grant), but I manually traced the fixture line counts against the new threshold logic above and they check out. If your --allowedTools config can permit perl sql/test/*.t for this bot, I could run them directly next time.

No bugs or regressions found. Nothing blocking.

@jnasbyupgrade
jnasbyupgrade merged commit e4fab69 into main Aug 12, 2026
4 checks passed
@jnasbyupgrade
jnasbyupgrade deleted the worktree-valiant-doodling-pascal branch August 12, 2026 21:25
jnasbyupgrade added a commit to Postgres-Extensions/object_reference that referenced this pull request Aug 12, 2026
Postgres-Extensions/linter#9 tightens comment-stacked-dashes to flag 2+
consecutive -- lines (previously 3+). Bumps b40aaf70 -> e4fab69e.
jnasbyupgrade added a commit to Postgres-Extensions/test_factory that referenced this pull request Aug 12, 2026
Postgres-Extensions/linter#9 tightens comment-stacked-dashes to flag 2+
consecutive -- lines (previously 3+). Bumps 97c89b92 -> e4fab69e.
jnasbyupgrade added a commit to Postgres-Extensions/extension_tools that referenced this pull request Aug 12, 2026
Postgres-Extensions/linter#9 tightens comment-stacked-dashes to flag 2+
consecutive -- lines (previously 3+). Bumps b8632c2a -> e4fab69e.
jnasbyupgrade added a commit to Postgres-Extensions/pg_count_nulls that referenced this pull request Aug 12, 2026
Postgres-Extensions/linter#9 tightens comment-stacked-dashes to flag 2+
consecutive -- lines (previously 3+). Bumps b40aaf70 -> e4fab69e.
jnasbyupgrade added a commit to Postgres-Extensions/cat_tools that referenced this pull request Aug 12, 2026
Postgres-Extensions/linter#9 tightens comment-stacked-dashes to flag 2+
consecutive -- lines (previously 3+). Bumps b8632c2a -> e4fab69e.
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