Skip to content

Commit 88ec07d

Browse files
committed
Tidy up golangci-lint configuration
1 parent 30119fc commit 88ec07d

File tree

5 files changed

+8
-29
lines changed

5 files changed

+8
-29
lines changed

.golangci.yml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ linters:
1212
- exportloopref
1313
- forbidigo
1414
- gci
15-
- gochecknoinits
1615
- gocritic
1716
- godot
1817
- goerr113
@@ -29,7 +28,6 @@ linters:
2928
- interfacer
3029
- makezero
3130
- misspell
32-
- paralleltest
3331
- prealloc
3432
- predeclared
3533
- rowserrcheck
@@ -39,7 +37,6 @@ linters:
3937
- structcheck
4038
- stylecheck
4139
- thelper
42-
- tparallel
4340
- typecheck
4441
- unconvert
4542
- unparam
@@ -50,6 +47,7 @@ linters:
5047
- exhaustivestruct
5148
- funlen
5249
- gochecknoglobals
50+
- gochecknoinits
5351
- gocognit
5452
- goconst
5553
- gocyclo
@@ -62,8 +60,10 @@ linters:
6260
- nestif
6361
- nlreturn
6462
- noctx
65-
- nolintlint # FIXME renable
63+
- nolintlint # FIXME re-enable
64+
- paralleltest
6665
- testpackage
66+
- tparallel
6767
- wrapcheck
6868
- wsl
6969

@@ -82,30 +82,15 @@ issues:
8282
text: "do not define dynamic errors, use wrapped static errors instead"
8383
- linters:
8484
- dupl
85-
path: "secretgopass.go"
86-
- linters:
87-
- dupl
88-
path: "secretpass.go"
89-
- linters:
90-
- nolintlint
91-
- paralleltest
92-
path: "^main_test.go$"
85+
path: "^cmd/secret(go)?pass\\.go$"
9386
- linters:
9487
- forbidigo
95-
- gochecknoinits
96-
- paralleltest
97-
path: cmd/
98-
- linters:
99-
- gochecknoinits
100-
path: internal/chezmoi/chezmoi_unix.go
88+
path: ^cmd/
10189
- linters:
10290
- forbidigo
10391
- gosec
104-
path: internal/cmd/
105-
- linters:
106-
- paralleltest
107-
path: internal/
92+
path: ^internal/cmd/
10893
- linters:
10994
- gosec
11095
- scopelint
111-
path: "_test\\.go"
96+
path: "_test\\.go$"

chezmoi2/cmd/keepassxctemplatefuncs.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ func (c *Config) keepassxcVersion() *semver.Version {
121121
func (c *Config) runKeepassxcCLICommand(name string, args []string) ([]byte, error) {
122122
if c.Keepassxc.password == "" {
123123
password, err := c.readPassword(fmt.Sprintf("Insert password to unlock %s: ", c.Keepassxc.Database))
124-
fmt.Println()
125124
if err != nil {
126125
return nil, err
127126
}

chezmoi2/internal/chezmoi/chezmoi_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/rs/zerolog/pkgerrors"
99
)
1010

11-
//nolint:gochecknoinits
1211
func init() {
1312
log.Logger = log.Output(zerolog.ConsoleWriter{
1413
Out: os.Stderr,

chezmoi2/main_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ func TestMain(m *testing.M) {
4242
}))
4343
}
4444

45-
//nolint:paralleltest
4645
func TestScript(t *testing.T) {
4746
testscript.Run(t, testscript.Params{
4847
Dir: filepath.Join("testdata", "scripts"),

main_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ func cmdEdit(ts *testscript.TestScript, neg bool, args []string) {
130130
ts.Fatalf("edit: %v", err)
131131
}
132132
data = append(data, []byte("# edited\n")...)
133-
//nolint:gosec
134133
if err := ioutil.WriteFile(filename, data, 0o666); err != nil {
135134
ts.Fatalf("edit: %v", err)
136135
}
@@ -266,7 +265,6 @@ func cmdRmFinalNewline(ts *testscript.TestScript, neg bool, args []string) {
266265
if len(data) == 0 || data[len(data)-1] != '\n' {
267266
continue
268267
}
269-
//nolint:gosec
270268
if err := ioutil.WriteFile(filename, data[:len(data)-1], 0o666); err != nil {
271269
ts.Fatalf("%s: %v", filename, err)
272270
}
@@ -287,7 +285,6 @@ func cmdUNIX2DOS(ts *testscript.TestScript, neg bool, args []string) {
287285
ts.Check(err)
288286
dosData, err := unix2DOS(data)
289287
ts.Check(err)
290-
//nolint:gosec
291288
if err := ioutil.WriteFile(filename, dosData, 0o666); err != nil {
292289
ts.Fatalf("%s: %v", filename, err)
293290
}

0 commit comments

Comments
 (0)