-
Notifications
You must be signed in to change notification settings - Fork 56
fix linting and add golangci-lint #108
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
Open
thaJeztah
wants to merge
15
commits into
moby:main
Choose a base branch
from
thaJeztah:fix_linting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+298
−212
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7aef26c
gofumpt code
thaJeztah e39a7f2
linting: fix godoc comments
thaJeztah 761deb7
linting: remove unnecessary conversion (unconvert)
thaJeztah 91ef632
linting: fix errors should not be capitalized
thaJeztah 4cb9c35
linting: suppress some unparam warnings
thaJeztah 9fe9b6e
linting: fix comparing with == will fail on wrapped errors (errorlint)
thaJeztah 035f5d3
linting: fix or suppress unhandled errors (errcheck)
thaJeztah 1350f34
lintint: suppress unhandled errors (errcheck)
thaJeztah 15e8699
linting: fix assignOp warnings (gocritic)
thaJeztah 9763e78
linting: fix nakedret, nonamedreturns
thaJeztah 800b3db
linting: fix thelper, usestdlibvars
thaJeztah 4b920f2
linting: use errors.New (perfsprint)
thaJeztah ad9cc5d
linting: fix bodyclose, canonicalheader in tests
thaJeztah 3faad8a
lintint: fix / suppress forcetypeassert
thaJeztah 784cb28
ci: add golangci-lint
thaJeztah 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 hidden or 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 hidden or 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,65 @@ | ||
| version: "2" | ||
|
|
||
| linters: | ||
| enable: | ||
| - bodyclose | ||
| - canonicalheader | ||
| - errcheck | ||
| - errorlint | ||
| - forcetypeassert | ||
| - gocritic | ||
| - godoclint | ||
| - nakedret | ||
| - perfsprint | ||
| - staticcheck | ||
| - thelper | ||
| - unconvert | ||
| - unparam | ||
| - whitespace | ||
| exclusions: | ||
| generated: disable | ||
| presets: | ||
| - comments | ||
| - std-error-handling | ||
| rules: | ||
| - path: spdy/ | ||
| linters: | ||
| - nakedret | ||
| - nonamedreturns | ||
| - path: connection.go | ||
| linters: | ||
| - unparam | ||
| text: "result 0 \\(error\\) is always nil" # TODO(thaJeztah): check if errors should be returned | ||
| settings: | ||
| revive: | ||
| rules: | ||
| # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#var-naming | ||
| - name: var-naming | ||
| severity: warning | ||
| disabled: false | ||
| exclude: [""] | ||
| arguments: | ||
| - ["Id"] # AllowList | ||
| - [] # DenyList | ||
| - - skip-initialism-name-checks: true | ||
| upper-case-const: true | ||
| staticcheck: | ||
| # Enable all options, with some exceptions. | ||
| # For defaults, see https://golangci-lint.run/usage/linters/#staticcheck | ||
| checks: | ||
| - all | ||
| - -QF1008 # Omit embedded fields from selector expression; https://staticcheck.dev/docs/checks/#QF1008 | ||
| - -ST1003 # Poorly chosen identifier; https://staticcheck.dev/docs/checks/#ST1003 | ||
|
|
||
| formatters: | ||
| enable: | ||
| - gofumpt | ||
| exclusions: | ||
| generated: disable | ||
|
|
||
| issues: | ||
| # Maximum issues count per one linter. Set to 0 to disable. Default is 50. | ||
| max-issues-per-linter: 0 | ||
|
|
||
| # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. | ||
| max-same-issues: 0 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.