Skip to content

Commit

Permalink
Add make lint (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
hariso authored Jul 24, 2023
1 parent 6ee5a82 commit f9896cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# The version here also needs to be used as GOLANG_CI_LINT_VER in Makefile
version: v1.52.2

10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# the correct version.
VERSION=`git describe --tags --dirty`
GO_VERSION_CHECK=`./scripts/check-go-version.sh`
# Needs to match with what's in .github/workflows/lint.yml
GOLANG_CI_LINT_VER := v1.52.2

# The build target should stay at the top since we want it to be the default target.
build: check-go-version pkg/web/ui/dist build-pipeline-check
Expand All @@ -25,6 +27,14 @@ test-integration:
docker compose -f test/docker-compose-postgres.yml -f test/docker-compose-schemaregistry.yml down; \
exit $$ret

.PHONY: golangci-lint-install
golangci-lint-install:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANG_CI_LINT_VER)

.PHONY: lint
lint: golangci-lint-install
golangci-lint run -v

build-server: check-go-version
go build -ldflags "-X 'github.com/conduitio/conduit/pkg/conduit.version=${VERSION}'" -o conduit ./cmd/conduit/main.go
@echo "build version: ${VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
EXIT_STATUS=0
make test || EXIT_STATUS=$?
golangci-lint run || EXIT_STATUS=$?
make lint || EXIT_STATUS=$?
make markdown-lint || EXIT_STATUS=$?
exit $EXIT_STATUS

0 comments on commit f9896cb

Please sign in to comment.