-
Notifications
You must be signed in to change notification settings - Fork 562
Integrate golangci-lint to run aggregate linting checks for CI #2536
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
run: | ||
timeout: 5m | ||
skip-dirs: | ||
- pkg/lib | ||
- pkg/api | ||
- pkg/fakes | ||
- pkg/package-server/apis | ||
- test/e2e | ||
|
||
linters: | ||
enable: | ||
- depguard | ||
- gofmt | ||
- goimports | ||
- importas | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to tackle adding a more fleshed out importas configuration ( e.g. enforcing consistency with corev1/metav1/operatorsv1alpha1/etc. package alias') as a follow-up. |
||
- misspell | ||
- stylecheck | ||
- tparallel | ||
- unconvert | ||
- whitespace | ||
disable: | ||
- errcheck | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing this can be done in a follow-up PR. |
||
|
||
issues: | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
Comment on lines
+25
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting both of these configuration options limit the number of linting violations that are discovered at a time. Setting the values to |
||
|
||
output: | ||
format: tab | ||
sort-results: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ var ( | |
tlsCertPath = flag.String( | ||
"tls-cert", "", "Path to use for certificate key (requires tls-key)") | ||
|
||
profiling = flag.Bool("profiling", false, "deprecated") | ||
_ = flag.Bool("profiling", false, "deprecated") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This flag is currently unused right now since we merge the profiling/metrics/health/etc. endpoints last minor release. I thought this was the easiest solution, vs. updating the .golangci-lint.yaml configuration and explicitly allowlisting this flag. |
||
|
||
clientCAPath = flag.String("client-ca", "", "path to watch for client ca bundle") | ||
|
||
|
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.