Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,14 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v6
- name: Lint SQL
# CRITICAL: call `make lint` directly, not some other path (a script, a
# different target, etc). lint.mk's vendored include is guarded on
# `$(wildcard .git)` so a source tarball (no .git) can still build/install
# -- if that guard ever went false here (checkout somehow left no .git),
# `lint` wouldn't exist as a target at all, and `make lint` fails loudly
# ("No rule to make target 'lint'") rather than silently skipping. Any
# wrapper that swallows that exit code or calls a different entry point
# would defeat this safety net.
run: make lint

# cancel-on-close.yml cancels in-flight CI/claude-review runs on PR close by
Expand Down
13 changes: 13 additions & 0 deletions lint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@
# Self-initializing (via the rule below) so `make lint` works right after a
# plain `git clone`, with no --recurse-submodules needed, and so CI can rely
# on the exact same entry point a developer would use locally.
#
# Guarded on $(wildcard .git): the top-level Makefile's `include lint.mk` is
# unconditional, so Make tries to satisfy this file's own includes before
# running ANY target. `git archive` (what `make dist`/PGXN ship) drops
# submodules and .git entirely, so on a released tarball the rule below would
# run `git submodule update` outside a git repo, fail, and abort the whole
# Makefile parse -- breaking even plain `make`/`make install` for every
# consumer, not just `make lint`. Skipping the include there is fine: PGXN
# consumers don't need the linter. $(wildcard .git) matches both a real
# .git directory (plain clone) and the .git file pointer used inside a git
# worktree, and is empty only when neither exists (a tarball extraction).
ifneq ($(wildcard .git),)
.vendor/linter/lint.mk:
git submodule update --init -- .vendor/linter

include .vendor/linter/lint.mk
endif
Loading