-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add golangci-lint to workflows (#34)
* Add golangci-lin.yml file to workflows * Make checkForNewVersion function not stop the code (#33) * Add golangci-lin.yml file to workflows * Add linting config file * Add more configs for outputs. Remove the config line in golangci-ling.yml * Fix whitespace issues * Add more linters and fix minor issues. * Disable typecheck linter. * Only run on new issues * Remove on push to main
- Loading branch information
Showing
36 changed files
with
113 additions
and
73 deletions.
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,16 @@ | ||
name: golangci-lint | ||
on: | ||
pull_request: | ||
branches: [ "*" ] | ||
|
||
jobs: | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.50.1 | ||
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,71 @@ | ||
run: | ||
# Timeout for analysis, e.g. 30s, 5m, default is 1m | ||
deadline: 3m | ||
|
||
# Exit code when at least one issue was found, default is 1 | ||
issues-exit-code: 1 | ||
|
||
# Include test files or not, default is true | ||
tests: true | ||
|
||
linters: | ||
# Enable specific linters | ||
enable: | ||
- whitespace | ||
- bodyclose | ||
- dupl | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- misspell | ||
- nakedret | ||
- prealloc | ||
- staticcheck | ||
- unparam | ||
- unused | ||
|
||
# Disable specific linters | ||
disable: | ||
- typecheck | ||
- gochecknoinits | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- godot | ||
- gofmt | ||
- goimports | ||
- ineffassign | ||
- lll | ||
- stylecheck | ||
- unconvert | ||
- megacheck | ||
- gas | ||
- dogsled | ||
- errcheck | ||
|
||
linters-settings: | ||
gocyclo: | ||
# Minimal code complexity to report | ||
min-complexity: 10 | ||
golint: | ||
# Minimal confidence to report a problem, low by default | ||
min-confidence: 0.8 | ||
unused: | ||
# Treat code as a program (not a library) and report unused exported identifiers; default is false. | ||
# The argument specifies the Go source directory to analyze. | ||
check-exported: false | ||
|
||
output: | ||
formats: | ||
- format: colored-line-number | ||
path: stdout | ||
print-issued-lines: true | ||
print-linter-name: true | ||
uniq-by-line: true | ||
sort-results: true | ||
sort-order: | ||
- file | ||
- linter | ||
- severity | ||
show-stats: 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
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
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
Oops, something went wrong.