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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MB-13908] Update golangci-lint config #9201

Merged
merged 7 commits into from
Sep 27, 2022
Merged

Conversation

reggieriser
Copy link
Contributor

@reggieriser reggieriser commented Sep 15, 2022

Jira ticket for this change

Summary

This PR updates and cleans up our golangci-lint config. Some of this work was deferred from #9064 when we added the gci linter. Specifically, the following changes are being made:

  • three linters that are now deprecated are being removed: deadcode, structcheck, and varcheck. Per the documentation, these linters were abandoned by the author and the unused linter should be used as the replacement for all three.
  • the list of linters noted in the enable section was not the complete list that were being run. There are several others that were enabled by default, including the unused one noted above. So, I've added gosimple and unused in explicitly here to avoid any confusion about what linters are actually running. If you want to see a list of all enabled linters, get a local version of golangci-lint and run golangci-lint linters.
  • the deadline setting under run has been deprecated and timeout should be used in its place.
  • instead of just skipping mocks directories, I skip any directory that ends in mocks since we do have a mocks directory called ghcmocks that we had to create to get around some circular dependency issues.
  • the workaround of setting a go version to 1.17 that we introduced when moving to go 1.18 has been removed because the problem linters have either been fixed or deprecated.
  • in removing the 1.17 workaround, I realized that an annotation and linter suppression added/approved in a previous PR was inadvertently removed in a subsequent PR's refactor. This PR adds it back.
  • the CODEOWNERS file was referencing the wrong filename for the golangci-lint config, so I've fixed that.

Setup to Run Your Code

How to test:

  • make clean server_build client_build build_tools
  • pre-commit run -a to make sure there are no linter issues
  • pre-commit run -a --verbose golangci-lint to see if there are any warnings about linters being turned off (there shouldn't be anymore)
  • golangci-lint linters to see a list of enabled/disabled linters for our configuration

Verification Steps for Author

These are to be checked by the author.

  • Request review from a member of a different team.
  • Have the Jira acceptance criteria been met for this change?

@robot-mymove
Copy link

robot-mymove commented Sep 15, 2022

Messages
📖 🔗 MB-13908

Generated by 🚫 dangerJS against 08d0996

@reggieriser reggieriser requested a review from a team September 26, 2022 22:10
Copy link
Contributor

@ahobson ahobson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mergify mergify bot merged commit c71bd2e into master Sep 27, 2022
@mergify mergify bot deleted the MB-13908-golangci-lint-config branch September 27, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants