-
I am using pre-commit-config.ymal file for linting the whole repository; more specifically, I am expecting to get pre-commit-config.ymlrepos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.63.4
hooks:
# no built-in support for multiple go.mod
# https://github.com/golangci/golangci-lint/issues/828
- id: golangci-lint-full
name: golangci-lint-full-a
entry: bash -c 'cd a && golangci-lint run --timeout=5m --enable=gofmt'
- id: golangci-lint-full
name: golangci-lint-full-parquet
entry: bash -c 'cd p && golangci-lint run'
- id: golangci-lint-full
name: golangci-lint-full-internal
entry: bash -c 'cd internal && golangci-lint run'
# - repo: local
# hooks:
# - id: go-fmt
# name: go fmt
# language: system
# entry: bash -c "go get golang.org/x/tools/cmd/goimports@latest && go fmt ./..."
# pass_filenames: false
.golangci.yamllinters:
# Disable all linters.
# Default: false
disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- gofmt
- goimports
- staticcheck
issues:
fix: true
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
First, Currently You don't provide enough information about your project to have a more precise answer. I recommend reading the v2 issue: #5300 |
Beta Was this translation helpful? Give feedback.
First,
go fmt
is different thangofmt
.Inside golangci-lint, we use
gofmt
.Currently
gofmt
is integrated as a linter, not as a formatter, so its scope is limited to the current module.You don't provide enough information about your project to have a more precise answer.
I recommend reading the v2 issue: #5300