From 7c5b57cf80b9e497cb71a993e8fb351478da2063 Mon Sep 17 00:00:00 2001 From: Polina Sizintseva Date: Tue, 20 Jan 2026 13:47:21 +0300 Subject: [PATCH] chore: run golangci-lint in docker Signed-off-by: Polina Sizintseva --- .golangci.yml | 3 +-- Taskfile.format_lint.yml | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 076f871..7fad827 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,7 +22,6 @@ linters: disable-all: true enable: - ineffassign - - typecheck - unused - asciicheck - bidichk @@ -45,4 +44,4 @@ issues: - scripts - stapel exclude: - - "non-wrapping format verb for fmt.Errorf" # errorlint \ No newline at end of file + - "non-wrapping format verb for fmt.Errorf" # errorlint diff --git a/Taskfile.format_lint.yml b/Taskfile.format_lint.yml index 30f998f..9805eda 100644 --- a/Taskfile.format_lint.yml +++ b/Taskfile.format_lint.yml @@ -4,6 +4,7 @@ silent: true env: PRETTIER_VERSION: "3.5.3" + GOLANGCI_LINT_VERSION: "v1.61.0" tasks: format: @@ -40,16 +41,16 @@ tasks: - lint:prettier lint:golangci-lint:cgo: - desc: 'Lint with golangci-lint for cgo. Important vars: "golangciPaths".' + desc: 'Lint with golangci-lint for cgo (docker). Important vars: "golangciPaths".' cmds: - - golangci-lint run --build-tags="{{.cgoTags}}" -c <(curl https://raw.githubusercontent.com/werf/common-ci/refs/heads/main/.golangci.yml) {{.CLI_ARGS}} {{.golangciPaths | default "./..."}} + - docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:${GOLANGCI_LINT_VERSION} bash -c 'golangci-lint run --build-tags="{{.cgoTags}}" -c <(curl -sSfL https://raw.githubusercontent.com/werf/common-ci/refs/heads/chore/golangci-lint-docker/.golangci.yml) {{.CLI_ARGS}} {{.golangciPaths | default "./..."}}' env: CGO_ENABLED: "1" lint:golangci-lint:go: - desc: 'Lint with golangci-lint without cgo. Important vars: "golangciPaths".' + desc: 'Lint with golangci-lint without cgo (docker). Important vars: "golangciPaths".' cmds: - - golangci-lint run --build-tags="{{.goTags}}" -c <(curl https://raw.githubusercontent.com/werf/common-ci/refs/heads/main/.golangci.yml) {{.CLI_ARGS}} {{.golangciPaths | default "./..."}} + - docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:${GOLANGCI_LINT_VERSION} bash -c 'golangci-lint run --build-tags="{{.goTags}}" -c <(curl -sSfL https://raw.githubusercontent.com/werf/common-ci/refs/heads/chore/golangci-lint-docker/.golangci.yml) {{.CLI_ARGS}} {{.golangciPaths | default "./..."}}' env: CGO_ENABLED: "0" @@ -69,7 +70,7 @@ tasks: golangciPaths: "{{.golangciPaths}}" lint:golangci-lint: - desc: 'Lint with golangci-lint (with and without cgo). Important vars: "golangciPaths".' + desc: 'Lint with golangci-lint (with and without cgo, docker-based). Important vars: "golangciPaths".' deps: - task: _lint:golangci-lint:{{ternary "cgo-and-go" "go" (eq .mode "cgo")}} vars: