-
Notifications
You must be signed in to change notification settings - Fork 103
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
golangci-lint workflow #262
Merged
Merged
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
3dd8ec4
draft golangci-lint workflow
uturunku1 222fe15
fix gh action error that says every step must define a or key
uturunku1 e8279f2
1.42.1 is an invalid version
uturunku1 6bfaa45
temporarily commenting the option only-new-issues to correct old issues
uturunku1 e14e068
apply golangci-lint recommendations: remove unused code which is ever…
uturunku1 08332ca
add back file because its functions are being used, is just that gola…
uturunku1 9f58003
add flag to ignore test files
uturunku1 5b21f13
add yml for golangci configuration and add setting to ignore unused f…
uturunku1 13c20e5
remove extra lines
uturunku1 413f623
pin to version 1.29 to compare behaviour with version 1.40
uturunku1 3c44683
enable some useful lint libraries and use go version 1.16 and golangc…
uturunku1 be0ed9d
golangci-lint library recommends to stop using golint because it is d…
uturunku1 771ab13
fix new issues point by golangci-lint
uturunku1 cabf350
clarify comment on why we are not using golint
uturunku1 1689acd
enable other lint libraries that I liked their description and add ad…
uturunku1 a573060
add configuration to golangci-lint and fix errors mentioned by enable…
uturunku1 2e17d84
remove not useful comments
uturunku1 1cb63d4
match lowercase in tests
uturunku1 8b80493
missing test
uturunku1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-version: [1.16.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.42 | ||
#only-new-issues: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
run: | ||
timeout: 5m | ||
linters: | ||
enable: | ||
- gosimple | ||
- stylecheck | ||
- revive #golint is deprecated and golangci-lint recommends to use revive instead | ||
#other deprecated lint libraries: maligned, scopelint, interfacer | ||
issues: | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- unused | ||
- deadcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the docs say that this
gosimple
plus others are enabled by default. Part of that list includes errcheck. But when I runerrcheck -verbose ./...
locally, i getIt doesn't seem like these are enabled by default then? I think we should add all those that are supposed to be enabled by default explicitly here. So