Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable golangci-lint and fix issues #3023

Merged
merged 13 commits into from May 22, 2024

Conversation

stephenfin
Copy link
Contributor

This PR comes out of comments from @EmilienM in #2940 and depends on same. Add golangci-lint to the lint target added by that PR. Most of the changes are noddy and don't really benefit us massively, but fixing them is easier than ignoring them on a file-by-file basis 馃槃.

Commits
  • Add minimal Makefile
  • make: Add golangci-lint to lint target
  • lint: Remove redundant returns (gosimple)
  • lint: Remove unnecessary guards around calls to delete (gosimple)
  • lint: Remove unnecessary assignments to the blank identifier (gosimple)
  • lint: Remove unused variables (unused)
  • lint: Check all return codes (errcheck)
  • lint: Resolve ineffectual assignments to err (ineffassign)
  • lint: Simplify various bits of code (gosimple)
  • lint: Remove unused variables (staticcheck)
  • lint: Resolve nil pointer dereference (staticcheck)
  • lint: Use strings.Equalfold (staticcheck)
  • lint: Replace use of deprecated stdlib functions (staticcheck)
  • lint: Enable additional linters

Depends-On: #2940

@github-actions github-actions bot added the semver:patch No API change label Apr 4, 2024
@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels Apr 4, 2024
@coveralls
Copy link

coveralls commented Apr 5, 2024

Coverage Status

coverage: 78.696% (+0.06%) from 78.634%
when pulling 19e8a7d on stephenfin:golangci-lint
into d4b3480 on gophercloud:master.

@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels Apr 15, 2024
@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels Apr 15, 2024
@github-actions github-actions bot removed the semver:patch No API change label Apr 17, 2024
@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels Apr 17, 2024
@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels May 15, 2024
Plus a note for Fedora users. All current failures are ignored while we
work on fixing them.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This resolves remaining issues with the gosimple linter.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We ignore the two warnings since (a) string.Title is perfectly fine for
our use case here, and (b) x509.EncryptPEMBlock is only used in tests.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Fix in the one go. We can remove the separate 'go vet' and 'go fmt'
invocations since these are now run by golangci-lint

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels May 20, 2024
@stephenfin
Copy link
Contributor Author

@EmilienM I think this is good to go. The failures appear to be unrelated (the baremetal one is fixed by #3052)

@EmilienM
Copy link
Contributor

huge work. Thanks

@EmilienM EmilienM merged commit 6eb9275 into gophercloud:master May 22, 2024
69 of 73 checks passed
@stephenfin stephenfin deleted the golangci-lint branch May 22, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch No API change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants