Skip to content

Commit 0c67d00

Browse files
Add pre-commit hook to run config verify
Add this as a way to easily ensure configs stay valid. Filenames are not passed to the hook, this means For the default case (config in one of the default searched files), the config is picked up automatically and there's nothing extra to configure. For the case of a non-standard config setup the hook can be configured like repos: - repo: https://github.com/golangci/golangci-lint rev: v1.57.2 hooks: - id: golangci-lint-config-verify # config is kept at '.golangci-config.yaml' files: \.golangci-config\.yaml args: ['--config', '.golangci-config.yaml']
1 parent d318327 commit 0c67d00

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.pre-commit-hooks.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@
1414
language: golang
1515
require_serial: true
1616
pass_filenames: false
17+
- id: golangci-lint-config-verify
18+
name: golangci-lint-config-verify
19+
description: Verifies the configuration file
20+
entry: golangci-lint config verify
21+
files: '\.golangci\.(?:yml|yaml|toml|json)'
22+
language: golang
23+
pass_filenames: false

0 commit comments

Comments
 (0)