mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-10-22 04:32:02 +02:00
ci: use go tool for running golangci-lint
Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
@@ -46,6 +46,15 @@
|
|||||||
depNameTemplate: "alpine",
|
depNameTemplate: "alpine",
|
||||||
datasourceTemplate: "docker",
|
datasourceTemplate: "docker",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
customType: "regex",
|
||||||
|
fileMatch: [
|
||||||
|
"^Makefile",
|
||||||
|
],
|
||||||
|
matchStrings: [
|
||||||
|
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\s+?GOLANGCILINT_VERSION \\?= (?<currentValue>.*)\\s",
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
customType: "regex",
|
customType: "regex",
|
||||||
fileMatch: ["(^|/)\\.github/workflows/[^/]+\\.ya?ml$"],
|
fileMatch: ["(^|/)\\.github/workflows/[^/]+\\.ya?ml$"],
|
||||||
|
|||||||
@@ -35,12 +35,6 @@ jobs:
|
|||||||
go-version: ${{ steps.go-version.outputs.version }}
|
go-version: ${{ steps.go-version.outputs.version }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Install golangci-lint
|
|
||||||
uses: golangci/golangci-lint-action@v9
|
|
||||||
with:
|
|
||||||
install-only: true
|
|
||||||
version: v2.11.4 # renovate: datasource=github-tags depName=golangci/golangci-lint
|
|
||||||
|
|
||||||
- name: Verify Code Generation
|
- name: Verify Code Generation
|
||||||
run: |
|
run: |
|
||||||
make verify-generate
|
make verify-generate
|
||||||
|
|||||||
@@ -55,12 +55,6 @@ jobs:
|
|||||||
go-version: ${{ steps.go-version.outputs.version }}
|
go-version: ${{ steps.go-version.outputs.version }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Install golangci-lint
|
|
||||||
uses: golangci/golangci-lint-action@v9
|
|
||||||
with:
|
|
||||||
install-only: true
|
|
||||||
version: v2.11.4 # renovate: datasource=github-tags depName=golangci/golangci-lint
|
|
||||||
|
|
||||||
- name: Get go dependencies
|
- name: Get go dependencies
|
||||||
run: |
|
run: |
|
||||||
go mod download
|
go mod download
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ help: ## Display this help
|
|||||||
|
|
||||||
|
|
||||||
GO ?= go
|
GO ?= go
|
||||||
GOLANGCILINT ?= golangci-lint
|
# renovate: datasource=github-tags depName=golangci/golangci-lint
|
||||||
|
GOLANGCILINT_VERSION ?= v2.11.4
|
||||||
|
|
||||||
BINARY := oauth2-proxy
|
BINARY := oauth2-proxy
|
||||||
VERSION ?= $(shell git describe --always --dirty --tags 2>/dev/null || echo "undefined")
|
VERSION ?= $(shell git describe --always --dirty --tags 2>/dev/null || echo "undefined")
|
||||||
@@ -143,7 +144,7 @@ verify-generate: generate ## Verify command to check if alpha config docs are in
|
|||||||
##@ Miscellaneous
|
##@ Miscellaneous
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: lint ## Run all Go tests
|
test: ## Run all Go tests
|
||||||
GO111MODULE=on $(GO) test $(TESTCOVER) -v -race ./...
|
GO111MODULE=on $(GO) test $(TESTCOVER) -v -race ./...
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
@@ -157,7 +158,11 @@ clean: ## Cleanup release and build files
|
|||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: validate-go-version ## Lint all files using golangci-lint
|
lint: validate-go-version ## Lint all files using golangci-lint
|
||||||
GO111MODULE=on $(GOLANGCILINT) run
|
GO111MODULE=on $(GO) run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCILINT_VERSION) run --timeout 10m
|
||||||
|
|
||||||
|
.PHONY: lint-fix
|
||||||
|
lint-fix: validate-go-version ## Lint all files and apply fixes using golangci-lint
|
||||||
|
GO111MODULE=on $(GO) run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCILINT_VERSION) run --timeout 10m --fix
|
||||||
|
|
||||||
.PHONY: validate-go-version
|
.PHONY: validate-go-version
|
||||||
validate-go-version: ## Validate Go environment requirements
|
validate-go-version: ## Validate Go environment requirements
|
||||||
|
|||||||
Reference in New Issue
Block a user