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

sso: enable golangci-lint #199

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

sso: enable golangci-lint #199

wants to merge 1 commit into from

Conversation

jphines
Copy link
Contributor

@jphines jphines commented May 22, 2019

Problem

We have a limited number of linters and other static code analyzers. We should add more to improve our codebase and make review better and easier.

Solution

golangci-lint https://github.com/golangci/golangci-lint is the newest replacement for gometalinter which has been the staple multi-lint tool. This PR adds support for golangci-lint as well as fixes the codebase so it runs cleanly.

Notes

Default linters include:

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

We also enable additional linters:

  • gofmt
  • golint
  • gocritic
  • gosec
  • misspell

We can add other linters in the future but I'd like to focus on getting the defaults

@jphines jphines self-assigned this May 22, 2019
- run:
name: copy source
command: |
mkdir bin
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't make much sense in context (it doesn't copy source!)

exit 1
fi
echo "running golangci-lint ..."
golangci-lint run -E gofmt -E golint -E gocritic -E gosec -E misspell
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should move into a config file so running golangci-lint locally is consistent with what is run in CI

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.

1 participant