Skip to content

Commit e1451b8

Browse files
authored
chore: add support for musttag and other linters (#4059)
1 parent 55490c2 commit e1451b8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ linters:
1616
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]
1717
- durationcheck # check for two durations multiplied together [fast: false, auto-fix: false]
1818
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false]
19+
- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false]
1920
- gci # Gci controls golang package import order and makes it always deterministic. [fast: true, auto-fix: false]
21+
- gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid. [fast: true, auto-fix: false]
22+
- gochecksumtype # Run exhaustiveness checks on Go "sum types" [fast: false, auto-fix: false]
2023
- goconst # Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false]
2124
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
2225
- gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true]
@@ -35,10 +38,13 @@ linters:
3538
- makezero # Finds slice declarations with non-zero initial length [fast: false, auto-fix: false]
3639
- mirror # reports wrong mirror patterns of bytes/strings usage [fast: false, auto-fix: false]
3740
- misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true]
41+
- musttag # enforce field tags in (un)marshaled structs [fast: false, auto-fix: false]
3842
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
3943
- nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]
4044
- prealloc # Finds slice declarations that could potentially be pre-allocated [fast: true, auto-fix: false]
4145
- predeclared # find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false]
46+
- promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false]
47+
- protogetter # Reports direct reads from proto message fields when getters should be used [fast: false, auto-fix: true]
4248
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false]
4349
- rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false]
4450
- sloglint # ensure consistent code style when using log/slog [fast: false, auto-fix: false]

internal/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ alias:
4747
)
4848

4949
type Config struct {
50-
Alias *alias.Config `json:"alias"`
51-
Output string `json:"output"`
50+
Alias *alias.Config `json:"alias" yaml:"alias"`
51+
Output string `json:"output" yaml:"output"`
5252

5353
path string
5454
}

0 commit comments

Comments
 (0)