Skip to content

Commit 99e176b

Browse files
committed
Fix make lint-api
Signed-off-by: Stefan Büringer [email protected]
1 parent 4599775 commit 99e176b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/pr-golangci-lint.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
- packaging
2121
steps:
2222
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag=v5.0.0
23+
with:
24+
fetch-depth: 0 # needed for --new-from-rev
2325
- name: Calculate go version
2426
id: vars
2527
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
@@ -33,4 +35,4 @@ jobs:
3335
version: v2.1.0
3436
working-directory: ${{matrix.working-directory}}
3537
- name: Lint API
36-
run: make lint-api
38+
run: GOLANGCI_LINT_API_EXTRA_ARGS=--new-from-rev=${{ github.event.pull_request.base.sha }} make lint-api

.golangci-kal.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,3 @@ linters:
9494
issues:
9595
max-same-issues: 0
9696
max-issues-per-linter: 0
97-
new-from-merge-base: main

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,11 @@ lint: $(GOLANGCI_LINT) $(GOLANGCI_LINT_KAL) ## Lint the codebase
480480
lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported by the linter
481481
GOLANGCI_LINT_EXTRA_ARGS=--fix $(MAKE) lint
482482

483+
GOLANGCI_LINT_API_EXTRA_ARGS ?= "--new-from-merge-base=main"
484+
483485
.PHONY: lint-api
484486
lint-api: $(GOLANGCI_LINT_KAL)
485-
$(GOLANGCI_LINT_KAL) run -v --config $(ROOT_DIR)/.golangci-kal.yml $(GOLANGCI_LINT_EXTRA_ARGS)
487+
$(GOLANGCI_LINT_KAL) run -v --config $(ROOT_DIR)/.golangci-kal.yml $(GOLANGCI_LINT_EXTRA_ARGS) $(GOLANGCI_LINT_API_EXTRA_ARGS)
486488

487489
.PHONY: lint-api-fix
488490
lint-api-fix: $(GOLANGCI_LINT_KAL)

0 commit comments

Comments
 (0)