From b3b6933ef4381315331ca93d991ced03876b392a Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sat, 11 Jun 2022 02:41:16 +0000 Subject: [PATCH] chore(lint): review exclude rules --- .golangci.yml | 28 ++++++++-------------------- internal/tun/create.go | 2 +- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8679059c..d7cb2f66 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,38 +7,26 @@ issues: - path: _test\.go linters: - dupl - - maligned - goerr113 - containedctx - - path: internal/server/ + - path: "internal\\/server\\/.+\\.go" linters: - dupl - - path: internal/configuration/ + - path: "internal\\/configuration\\/settings\\/.+\\.go" linters: - dupl - - path: internal/constants/ - linters: - - dupl - - text: "exported: exported var Err*" - linters: - - revive - - text: "mnd: Magic number: 0644*" + - text: "^mnd: Magic number: 0[0-9]{3}, in detected$" + source: "^.+= os\\.OpenFile\\(.+, .+, 0[0-9]{3}\\)" linters: - gomnd - - text: "mnd: Magic number: 0400*" + + - text: "^mnd: Magic number: 0[0-9]{3}, in detected$" + source: "^.+= os\\.MkdirAll\\(.+, 0[0-9]{3}\\)" linters: - gomnd - - text: "variable 'mssFix' is only used in the if-statement*" - path: "openvpnconf.go" - linters: - - ifshort - - text: "variable 'auth' is only used in the if-statement*" - path: "openvpnconf.go" - linters: - - ifshort - linters: - lll - source: "^//go:generate " + source: "^//go:generate .+$" - text: "returns interface \\(github\\.com\\/vishvananda\\/netlink\\.Link\\)" linters: - ireturn diff --git a/internal/tun/create.go b/internal/tun/create.go index 2e90dec9..521f29fa 100644 --- a/internal/tun/create.go +++ b/internal/tun/create.go @@ -11,7 +11,7 @@ import ( // Create creates a TUN device at the path specified. func (t *Tun) Create(path string) error { parentDir := filepath.Dir(path) - if err := os.MkdirAll(parentDir, 0751); err != nil { //nolint:gomnd + if err := os.MkdirAll(parentDir, 0751); err != nil { return err }