Skip to content

git pre-push hooks for linting#600

Merged
morgo merged 9 commits intoblock:mainfrom
Kiran01bm:kiran01bm/tooling/git-hooks-lint-docker
Feb 24, 2026
Merged

git pre-push hooks for linting#600
morgo merged 9 commits intoblock:mainfrom
Kiran01bm:kiran01bm/tooling/git-hooks-lint-docker

Conversation

@Kiran01bm
Copy link
Collaborator

@Kiran01bm Kiran01bm commented Feb 23, 2026

What and Why ?

Local dev-tooling enhancement - Adding pre-push hook for linter checks.

Everything runs in containers (no local Go tools needed), allows consistency i.e same linter version for all developers, catches errors before they reach CI/CD, bypass using git push --no-verify (when needed), doc-updates and simple opt-in integration via make lint, make setup-hooks.

Example:

ζ git push --set-upstream origin kiran01bm/tooling/git-hooks-lint-docker
Running golangci-lint in Docker before push...
pkg/statement/parse_create_table.go:1099:4: QF1012: Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)) (staticcheck)
			sb.WriteString(fmt.Sprintf(" `%s`", constraint.Name))
			^
pkg/statement/parse_create_table.go:1108:4: QF1012: Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)) (staticcheck)
			sb.WriteString(fmt.Sprintf("`%s`", key.Column.Name.String()))
			^
pkg/statement/parse_create_table.go:1111:5: QF1012: Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)) (staticcheck)
				sb.WriteString(fmt.Sprintf("(%d)", key.Length))
				^
3 issues:
* staticcheck: 3

❌ Linting failed! Please fix the errors before pushing.

To see detailed errors, run:
  docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:latest golangci-lint run --timeout=5m

To bypass this check (not recommended), use:
  git push --no-verify

error: failed to push some refs to 'github.com:Kiran01bm/spirit.git'

@Kiran01bm Kiran01bm requested a review from morgo February 23, 2026 02:20
@Kiran01bm Kiran01bm requested a review from morgo February 23, 2026 18:16
@morgo morgo self-requested a review February 24, 2026 22:51
@morgo morgo enabled auto-merge February 24, 2026 22:52
@morgo morgo merged commit ea37b51 into block:main Feb 24, 2026
9 of 11 checks passed
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.

2 participants