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
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ on:
- master
pull_request:
jobs:
lint:
name: 🧹 SQL lint
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: make lint
# Deliberately not pre-initializing the .vendor/linter submodule via
# `submodules:` above -- letting `make lint` self-init it (lint.mk)
# is what actually proves that works from a plain clone.
run: make lint

test:
strategy:
matrix:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".vendor/linter"]
path = .vendor/linter
url = https://github.com/Postgres-Extensions/linter.git
1 change: 1 addition & 0 deletions .vendor/linter
Submodule linter added at b40aaf
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ include pgxntool/base.mk

# Temporary hack
testdeps: $(wildcard test/*/*.sql) $(wildcard test/*.sql) # Be careful not to include directories in this

# sql/count_nulls.sql is the hand-written source the versioned sql/count_nulls--*.sql
# files are generated/derived from; those aren't relinted (see linter's DESIGN.md).
LINT_TARGETS = sql/count_nulls.sql test/
include lint.mk
7 changes: 7 additions & 0 deletions lint.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# lint.mk — thin wrapper; the whole local footprint for consuming
# https://github.com/Postgres-Extensions/linter. Everything else lives in
# the .vendor/linter submodule; see its README for available targets/rules.
.vendor/linter/lint.mk:
git submodule update --init -- .vendor/linter

include .vendor/linter/lint.mk
4 changes: 2 additions & 2 deletions test/core/functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $$;
* mistake!
*/

/*
/* EXCLUDED CODE — unused boilerplate template for new test functions, not meant to be enabled
CREATE FUNCTION test__
() RETURNS SETOF text LANGUAGE plpgsql AS $body$
DECLARE
Expand Down Expand Up @@ -180,7 +180,7 @@ BEGIN
);

-- Doesn't work for array types
/*
/* EXCLUDED CODE — doesn't work for array types
RETURN NEXT bag_eq(
$$SELECT a, b, c, null_count( array[a], array[b], array[c] ) FROM test_data$$
, $$SELECT * FROM test_data$$
Expand Down
Loading