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

Add golangci lint #366

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kavfixnel
Copy link
Contributor

Description

golangci-lint

This PR adds golangci-lint to this repo, enforces a few good and standard Go practices with the default linters:

  • deadcode
  • errcheck
  • gosimple
  • govet
  • ineffassign
  • staticcheck
  • structcheck
  • typecheck
  • unused
  • varcheck

And two extra linters that a nice to have to follow stylistic conventions.

  • whitespace
  • gofmt

Makefile makeover

Added .PHONY tags to the makefile, since the target don't actually point to any files. I also added independent targets for vet, lint and test for easy individual execution and linked then all up to quality.

Rest of the changes

The rest of the changes are only to make the linter happy. Conventions weren't followed in some places (errors weren't being checked, etc.), so this just fixes and brings everything up to standard.

Checklist

Please make sure that your PR fulfills the following requirements:

  • Reviewed the guidelines for contributing to this repository
  • The commit message follows the Conventional Commits Guidelines.
  • Tests for the changes have been updated
  • Are you adding dependencies? If so, please run go mod tidy -compat=1.17 to ensure only the minimum is pulled in.
  • Docs have been added / updated
  • Optional. My organization is added to USERS.md.

Type of Change

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • New tests
  • Build/CI related changes
  • Documentation content changes
  • Other (please describe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant