-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable ginkgolinter and fix findings (#126)
* Enable ginkgolinter and fix findings ginkgolinter finds bugs and enforces standards of using the ginkgo and gomega packages. See more details here: https://github.com/nunnatsa/ginkgolinter This PR enables the ginkgolinter in the .golangci.yml, and fixes all the new finding from running golangci-lint. Note: all the finding were auto fixed by running the ginkgolinter cli with the `-fix` flag. Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com> * Fix the assertMetrics test helper function The assertMetrics function in handler/instrumented_enqueue_object_test.go, wasn't really doing anything. The switch-case compared a pointer value to another pointer, so the no case was actually ever selected, because the addresses were not the same. Tested with a debugger - no value were ever selected. This commit fixes this test by selecting the value rather than the address. Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com> * Simplify error check in tests Replace this patter: ```golang err := someFuncRetOnlyErr() Expect(err).ToNot(HaveOccurred() ``` With ```golang Expect(someFuncRetOnlyErr()).To(Succeed()) ``` Also, use the `MatchError` gomega matcher when checking errors. Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com> --------- Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
- Loading branch information
Showing
9 changed files
with
168 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ linters: | |
- asciicheck | ||
- bodyclose | ||
- errorlint | ||
- ginkgolinter | ||
- gofmt | ||
- goimports | ||
- gosec | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.