Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

sso: enable golangci-lint#199

Draft
jphines wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromgolangci-lint
Draft

sso: enable golangci-lint#199

jphines wants to merge1 commit intomainfromgolangci-lint

Conversation

jphines
Copy link
Contributor

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-linthttps://github.com/golangci/golangci-lint is the newest replacement forgometalinter which has been the staple multi-lint tool. This PR adds support forgolangci-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

@jphinesjphines self-assigned thisMay 22, 2019
- run:
name: copy source
command: |
mkdir bin
Copy link
ContributorAuthor

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
ContributorAuthor

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 runninggolangci-lint locally is consistent with what is run in CI

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@jphinesjphines

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@jphines

[8]ページ先頭

©2009-2025 Movatter.jp