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
4 changes: 3 additions & 1 deletion .github/workflows/pr-golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- packaging
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag=v5.0.0
with:
fetch-depth: 0 # needed for --new-from-rev
- name: Calculate go version
id: vars
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
Expand All @@ -33,4 +35,4 @@ jobs:
version: v2.1.0
working-directory: ${{matrix.working-directory}}
- name: Lint API
run: make lint-api
run: GOLANGCI_LINT_API_EXTRA_ARGS=--new-from-rev=${{ github.event.pull_request.base.sha }} make lint-api
1 change: 0 additions & 1 deletion .golangci-kal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,3 @@ linters:
issues:
max-same-issues: 0
max-issues-per-linter: 0
new-from-merge-base: main
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,11 @@ lint: $(GOLANGCI_LINT) $(GOLANGCI_LINT_KAL) ## Lint the codebase
lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported by the linter
GOLANGCI_LINT_EXTRA_ARGS=--fix $(MAKE) lint

GOLANGCI_LINT_API_EXTRA_ARGS ?= "--new-from-merge-base=main"

.PHONY: lint-api
lint-api: $(GOLANGCI_LINT_KAL)
$(GOLANGCI_LINT_KAL) run -v --config $(ROOT_DIR)/.golangci-kal.yml $(GOLANGCI_LINT_EXTRA_ARGS)
$(GOLANGCI_LINT_KAL) run -v --config $(ROOT_DIR)/.golangci-kal.yml $(GOLANGCI_LINT_EXTRA_ARGS) $(GOLANGCI_LINT_API_EXTRA_ARGS)

.PHONY: lint-api-fix
lint-api-fix: $(GOLANGCI_LINT_KAL)
Expand Down