Skip to content

Commit

Permalink
Modernizing golangci-lint configuration for latest version syntax (#726)
Browse files Browse the repository at this point in the history
Golangci-lint config syntax has changed in recent version, this removes
warning messages from logs:
```
level=warning msg="[config_reader] The configuration option `run.skip-files` is deprecated, please use `issues.exclude-files`."
level=warning msg="[config_reader] The configuration option `run.skip-dirs` is deprecated, please use `issues.exclude-dirs`."
```
Timeout is now config defined not command-line switch
  • Loading branch information
radoslawc committed Apr 30, 2024
1 parent 889b5f9 commit aea1e11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
run:
skip-dirs:
- vendor
timeout: 10m

skip-files:
issues:
exclude-dirs:
- "vendor"

exclude-files:
- ".*\\_test.go$"

linters:
Expand Down
6 changes: 3 additions & 3 deletions default-go-lint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


GOLANG_CI_VER ?= v1.52
GOLANG_CI_VER ?= v1.57
GIT_ROOT_DIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
include $(GIT_ROOT_DIR)/detect-container-runtime.mk

Expand All @@ -22,7 +22,7 @@ include $(GIT_ROOT_DIR)/detect-container-runtime.mk
lint: ## Run Go linter against the codebase
ifeq ($(CONTAINER_RUNNABLE), 0)
$(RUN_CONTAINER_COMMAND) docker.io/golangci/golangci-lint:${GOLANG_CI_VER}-alpine \
golangci-lint run ./... -v --timeout 10m
golangci-lint run ./... -v
else
golangci-lint run ./... -v --timeout 10m
golangci-lint run ./... -v
endif

0 comments on commit aea1e11

Please sign in to comment.