Add SQL style linter (Postgres-Extensions/linter) - #41
Conversation
Vendor the shared org-wide SQL linter as a .vendor/linter submodule with a thin self-initializing lint.mk wrapper, wire it into the root Makefile scoped to sql/count_nulls.sql (the hand-written source; generated version snapshot files are excluded) and test/, and add a make lint CI job. test/core/functions.sql currently has 11 pre-existing comment-line-prefix findings (commented-out template/test code); the CI step is continue-on-error for now so this integration doesn't block on cleaning up that unrelated pre-existing debt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
continue-on-error on the make lint step masked real findings permanently, not just the known pre-existing ones -- any future violation would also report green. The linter (Postgres-Extensions/linter) has a purpose-built suppression convention for exactly this case: an `/* EXCLUDED CODE */` marker on the opening line of a block comment, which is an alias for `sql-lint:disable-block all` and skips comment-style checks for everything inside that block. Apply it narrowly to the two commented-out blocks in test/core/functions.sql that triggered the 11 comment-line-prefix findings (the unused test__ boilerplate template, and the disabled array-type test). make lint now finds 0 issues and exits 0 for real, so continue-on-error can be dropped entirely -- the lint job's pass/fail is now a true signal again.
|
Claude finished @jnasbyupgrade's task in 3m 5s —— View job Code Review: Add SQL style linter (Postgres-Extensions/linter)
Verification done: confirmed Overall this is a clean, well-scoped, minimal-footprint integration. A few notes: 1. PR description is stale re: 2. Submodule pinned to an arbitrary commit, not a tag 3. Scoping and markers look correct
No functional bugs found. This is ready to merge as-is; the two notes above are polish, not blockers. |
Vendor the shared org-wide SQL linter as a
.vendor/lintersubmodule with a thin self-initializinglint.mkwrapper, wire it into the root Makefile scoped tosql/count_nulls.sql(the hand-written source; generated version snapshot files likesql/count_nulls--*.sqlare excluded, per the linter's own DESIGN.md guidance on scopingLINT_TARGETS) plustest/, and add amake lintCI job that self-inits the submodule (checkout step deliberately does not pre-init it, so CI actually exercises that path).sql/count_nulls.sqlitself is clean.test/core/functions.sqlhad 11 pre-existingcomment-line-prefixfindings from two commented-out blocks (the boilerplatetest__function stub and a disabled array-type test). Rather than leave thelintjobcontinue-on-error: true(which would mask any future real violation too, not just these known ones), those two blocks are now marked with the linter's ownEXCLUDED CODEsuppression convention (an alias forsql-lint:disable-block all, meant for exactly this case).make lintreports 0 findings and exits 0 for real, so the CI job runs with nocontinue-on-errorand its pass/fail is a true signal.This is a standalone, one-off change targeting
masterdirectly (not part of the in-progress update/upgrade-test PR stack).