Skip to content

Commit

Permalink
ginkgolinter: enable all checks and fix findings (0xERR0R#1274)
Browse files Browse the repository at this point in the history
ginkgolinter configuration argument names may be a bit misleading.
Assuming the linter added to use it, this PR remove all the
supress-warning configurations.

Two error checks now found by the linter and fixed as well.
  • Loading branch information
nunnatsa authored Nov 26, 2023
1 parent 270dc17 commit 15bd383
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
15 changes: 0 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,7 @@ linters-settings:
ignored-numbers:
- "0666"
ginkgolinter:
# Suppress the wrong length assertion warning.
suppress-len-assertion: true
# Suppress the wrong nil assertion warning.
suppress-nil-assertion: true
# Suppress the wrong error assertion warning.
suppress-err-assertion: true
# Suppress the wrong comparison assertion warning.
suppress-compare-assertion: true
# Suppress the function all in async assertion warning.
suppress-async-assertion: true
# Suppress warning for comparing values from different types, like int32 and uint32
suppress-type-compare-assertion: true
# Trigger warning for ginkgo focus containers like FDescribe, FContext, FWhen or FIt
forbid-focus-container: true
# Don't trigger warnings for HaveLen(0)
allow-havelen-zero: true
stylecheck:
# Whietlist dot imports for test packages.
dot-import-whitelist:
Expand Down
6 changes: 2 additions & 4 deletions cmd/serve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ var _ = Describe("Serve command", func() {
By("terminate with signal", func() {
var startError error
Eventually(errChan, "10s").Should(Receive(&startError))
Expect(startError).ShouldNot(BeNil())
Expect(startError.Error()).Should(ContainSubstring("address already in use"))
Expect(startError).Should(MatchError(ContainSubstring("address already in use")))
})
})
})
Expand All @@ -121,8 +120,7 @@ var _ = Describe("Serve command", func() {
By("server should terminate with error", func() {
var startError error
Eventually(errChan).Should(Receive(&startError))
Expect(startError).ShouldNot(BeNil())
Expect(startError.Error()).Should(ContainSubstring("unable to load configuration"))
Expect(startError).Should(MatchError(ContainSubstring("unable to load configuration")))
})
})
})
Expand Down

0 comments on commit 15bd383

Please sign in to comment.