-
Notifications
You must be signed in to change notification settings - Fork 88
Reproduce linting checks from the main repo #121
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
021fae6
Reproduce linting checks from the main repo
danish9039 350500e
Merge branch 'main' into linting
danish9039 6d48964
Merge branch 'main' into linting
danish9039 c16eab6
fix
danish9039 509821e
fix
danish9039 b1e0649
add .golangci.yaml
danish9039 bb0ac7d
.
danish9039 5c95a17
Merge branch 'main' into linting
danish9039 f69b2b2
Merge branch 'main' into linting
danish9039 860498d
..
danish9039 3028884
Merge branch 'main' into linting
danish9039 7fd5068
..
danish9039 7c18c1a
removed setup-script job
danish9039 0e2fa1b
Merge branch 'main' into linting
danish9039 cc3ba98
..
danish9039 9788fb2
..
danish9039 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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
.idea/ | ||
gen-*/ | ||
.fmt.log | ||
.import.log | ||
.proto-gen-polyglot/ | ||
.scripts/ | ||
.tools/ | ||
coverage.txt | ||
|
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,118 @@ | ||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
- path: _test\.go | ||
linters: [gosec, bodyclose, noctx] | ||
- linters: [gocritic] | ||
text: "dupArg" | ||
- linters: [gocritic] | ||
text: "exitAfterDefer" | ||
- linters: [gocritic] | ||
text: "appendAssign" | ||
|
||
exclude-dirs-use-default: false | ||
exclude-files: | ||
- ".*.pb.go$" | ||
- "proto-gen/.*" | ||
- "model/v1/prototest/.*" | ||
|
||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
|
||
linters: | ||
disable: | ||
- errcheck | ||
enable: | ||
# Plain ASCII identifiers. | ||
- asciicheck | ||
|
||
# Checks for dangerous unicode character sequences. | ||
- bidichk | ||
|
||
# Checks whether HTTP response body is closed successfully. | ||
# TODO enable this but maybe find a way to disable in tests. | ||
- bodyclose | ||
|
||
# Check whether the function uses a non-inherited context. | ||
- contextcheck | ||
|
||
# Check declaration order of types, consts, vars and funcs. | ||
- decorder | ||
|
||
# Checks if package imports are in a list of acceptable packages (see cfg below). | ||
- depguard | ||
|
||
# Check for two durations multiplied together. | ||
- durationcheck | ||
|
||
# Checks `Err-` prefix for var and `-Error` suffix for error type. | ||
- errname | ||
|
||
# Suggests to use `%w` for error-wrapping. | ||
- errorlint | ||
|
||
# Checks for pointers to enclosing loop variables. | ||
- copyloopvar | ||
|
||
- gocritic | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
|
||
# Allow or ban replace directives in go.mod | ||
# or force explanation for retract directives. | ||
# Maybe enable once we get rid of old sarama. | ||
# - gomoddirectives | ||
|
||
- gosec | ||
|
||
# Linter that specializes in simplifying code. | ||
- gosimple | ||
- govet | ||
|
||
# Detects when assignments to existing variables are not used. | ||
- ineffassign | ||
|
||
- misspell | ||
|
||
# Finds naked/bare returns and requires change them. | ||
- nakedret | ||
|
||
# Require a bit more explicit returns. | ||
- nilerr | ||
|
||
# Finds sending HTTP request without context.Context. | ||
- noctx | ||
|
||
# Reports ill-formed or insufficient nolint directives. | ||
- nolintlint | ||
|
||
# Checks that fmt.Sprintf can be replaced with a faster alternative. | ||
- perfsprint | ||
|
||
# Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. | ||
- revive | ||
|
||
# Checks usage of github.com/stretchr/testify. | ||
- testifylint | ||
|
||
# Detects the possibility to use variables/constants from the Go standard library. | ||
- usestdlibvars | ||
|
||
# TODO consider adding more linters, cf. https://olegk.dev/go-linters-configuration-the-right-version | ||
|
||
linters-settings: | ||
danish9039 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
depguard: | ||
rules: | ||
main: | ||
files: ["$all"] | ||
allow: | ||
- "$gostd" | ||
- "github.com/stretchr/testify" | ||
- "github.com/gogo/protobuf" | ||
- "github.com/jaegertracing/jaeger-idl" | ||
|
||
run: | ||
go: "1.22" | ||
timeout: 20m |
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.
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.