Skip to content

Commit 7e724f8

Browse files
authored
refactor: update and improve linter configuration (#242)
* chore: update wsl linter configuration to version 5 Signed-off-by: Kim Oliver Drechsel <[email protected]> * refactor: streamline linting commands in Makefile Signed-off-by: Kim Oliver Drechsel <[email protected]> * refactor: clean up whitespace in test and function files Signed-off-by: Kim Oliver Drechsel <[email protected]> --------- Signed-off-by: Kim Oliver Drechsel <[email protected]>
1 parent d6b5389 commit 7e724f8

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ linters:
4141
- unused
4242
- wastedassign
4343
- wrapcheck
44-
- wsl
44+
- wsl_v5
4545
settings:
4646
lll:
4747
line-length: 160
@@ -52,6 +52,10 @@ linters:
5252
json: snake
5353
tfsdk: snake
5454
use-field-name: true
55+
wsl_v5:
56+
allow-first-in-block: true
57+
allow-whole-block: false
58+
branch-max-lines: 2
5559
exclusions:
5660
generated: lax
5761
presets:

Makefile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,13 @@ testacc:
1414
test:
1515
go test -v ./... -timeout 30m
1616

17-
lint:
18-
golangci-lint run ./...
19-
go run github.com/bflad/tfproviderlint/cmd/tfproviderlintx@latest ./...
17+
lint fmt:
18+
${GO_BIN}/golangci-lint run --fix ./...
19+
go tool tfproviderlintx -fix ./...
2020

2121
generate docs:
2222
go generate ./...
2323

24-
fmt:
25-
go fmt ./...
26-
-go tool gofumpt -l -w .
27-
-go tool goimports -l -w .
28-
-go tool wsl -strict-append -test=true -fix ./...
29-
-go tool perfsprint -fix ./...
30-
-go tool tfproviderlintx -fix ./...
31-
3224
download:
3325
@echo Download go.mod dependencies
3426
@go mod download

internal/api/client_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func TestClientCreateZoneInvalidTLD(t *testing.T) {
4848
t.Parallel()
4949

5050
var irrelevantConfig RequestConfig
51+
5152
client := createTestClient(t, irrelevantConfig)
5253
opts := CreateZoneOpts{Name: "thisisinvalid", TTL: 3600}
5354
_, err := client.CreateZone(context.Background(), opts)

internal/provider/idna_function.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func (r idnaFunction) Run(ctx context.Context, req function.RunRequest, resp *fu
4848
)
4949

5050
resp.Error = function.ConcatFuncErrors(req.Arguments.Get(ctx, &domain))
51-
5251
if resp.Error != nil {
5352
return
5453
}

0 commit comments

Comments
 (0)