Add sql-lint: style linter for PostgreSQL SQL files - #24
Open
jnasbyupgrade wants to merge 4 commits into
Open
Conversation
Add a linter, vendored as a git submodule at `.vendor/linter` (https://github.com/Postgres-Extensions/linter). Add to CI, and fix all linting issues. 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 |
# Conflicts: # pgxntool/pgtle.sh
sql/test_factory.sql: delete the commented-out _test_data schema branch instead of just marking it excluded from lint -- it's unreachable dead code. test/helpers/pgtap-core.sql and pgtap-schema.sql: these vendored copies of pgTAP's own SQL source are never sourced by anything (tests load pgTAP via `CREATE EXTENSION IF NOT EXISTS pgtap`, see test/helpers/tap_setup.sql). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jnasbyupgrade
marked this pull request as ready for review
July 31, 2026 19:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.vendor/linter, following the same pattern adopted incat_tools(Postgres-Extensions/cat_tools@b49b4bd).linttarget (via a thin locallint.mk) that self-initializes the submodule on first use, somake lintworks right after a plaingit clone.lintjob to CI that runsmake linton a plain checkout (no--recurse-submodules), which is what actually proves the self-init works.sql/test_factory.sql,test/deps.sql), and mark the vendored pgTAP helper files (test/helpers/pgtap-core.sql,test/helpers/pgtap-schema.sql) as excluded from linting since they're borrowed verbatim from the pgTAP project.Note: unlike the cat_tools commit this is modeled on, this repo doesn't use the
.sql.in→ generated-.sqlpipeline (frozen versioned snapshot files aren't checked into git here), so that part of the reference commit wasn't needed.Test plan
make lintpasses cleanly (0 findings)make lintself-initializes.vendor/linterfrom a fresh clone (verified by removing the submodule checkout and re-running)make teststill passes (3/3 regression tests)🤖 Generated with Claude Code