mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-12-06 16:22:15 +00:00
build(lint): pin golangci-lint v2.15.0 in the Makefile and lint through make in CI
This commit is contained in:
2
.github/actions/build-test-push/build.sh
vendored
2
.github/actions/build-test-push/build.sh
vendored
@@ -232,7 +232,7 @@ join() {
|
||||
# mode=max exports intermediate stages too, not just the final layers, which is
|
||||
# what makes the expensive apt and jlink stages reusable. type=registry, not
|
||||
# type=gha: the GitHub Actions cache is capped at 10 GB per repository and is
|
||||
# already carrying the Go and golangci-lint caches that the lint and test jobs
|
||||
# already carrying the Go caches that the lint and test jobs
|
||||
# depend on. Multi-GB image layers across five platforms would evict them.
|
||||
cache_flags() {
|
||||
local target="$1"
|
||||
|
||||
4
.github/workflows/continuous-integration.yml
vendored
4
.github/workflows/continuous-integration.yml
vendored
@@ -29,9 +29,7 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Run linters
|
||||
uses: golangci/golangci-lint-action@v9
|
||||
with:
|
||||
version: v2.15.0
|
||||
run: make lint
|
||||
|
||||
lint-prettier:
|
||||
name: Lint non-Golang codebase
|
||||
|
||||
12
Makefile
12
Makefile
@@ -209,9 +209,15 @@ test-integration: ## Run integration tests (automatically retries failed scenari
|
||||
--no-concurrency=$(NO_CONCURRENCY) \
|
||||
--tags="$(TAGS)"
|
||||
|
||||
# golangci-lint runs at a pinned version, so a Homebrew upgrade cannot move the
|
||||
# findings under the zero-warnings policy. An env var of the same name overrides
|
||||
# it.
|
||||
GOLANGCI_LINT_VERSION ?= v2.15.0
|
||||
GOLANGCI_LINT = go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
|
||||
|
||||
.PHONY: lint
|
||||
lint: ## Lint Golang codebase
|
||||
golangci-lint run
|
||||
$(GOLANGCI_LINT) run
|
||||
|
||||
.PHONY: lint-prettier
|
||||
lint-prettier: ## Lint non-Golang codebase
|
||||
@@ -219,7 +225,7 @@ lint-prettier: ## Lint non-Golang codebase
|
||||
|
||||
.PHONY: lint-todo
|
||||
lint-todo: ## Find TODOs in Golang codebase
|
||||
golangci-lint run --no-config --default=none --enable godox
|
||||
$(GOLANGCI_LINT) run --no-config --default=none --enable godox
|
||||
|
||||
# TODO: restore a plain "go fix ./..." once the errorsastype modernizer stops
|
||||
# rewriting this codebase into code that does not compile. Re-check by dropping
|
||||
@@ -232,7 +238,7 @@ lint-todo: ## Find TODOs in Golang codebase
|
||||
.PHONY: fmt
|
||||
fmt: ## Format Golang codebase and "optimize" the dependencies
|
||||
go fix -errorsastype=false ./...
|
||||
golangci-lint fmt
|
||||
$(GOLANGCI_LINT) fmt
|
||||
go mod tidy
|
||||
|
||||
.PHONY: prettify
|
||||
|
||||
Reference in New Issue
Block a user