-
Notifications
You must be signed in to change notification settings - Fork 68
OCPBUGS-43157: update goimports targets #370
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
OCPBUGS-43157: update goimports targets #370
Conversation
@elmiko: This pull request references Jira Issue OCPBUGS-43157, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/cherry-pick release-4.17 |
@elmiko: once the present PR merges, I will cherry-pick it on top of release-4.17 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@@ -69,7 +69,7 @@ vet: | |||
# Run golangci-lint against code | |||
.PHONY: lint | |||
lint: | |||
( GOLANGCI_LINT_CACHE=$(PROJECT_DIR)/.cache $(GOLANGCI_LINT) run --timeout 10m ) | |||
( GOLANGCI_LINT_CACHE=$(PROJECT_DIR)/.cache $(GOLANGCI_LINT) run --timeout 10m -v) |
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.
Given we had this before, and there was no config file, does that mean it was just running with the default linters?
I'm concerned that adding a config with just the one linter is now disabling the default linters, can you please check?
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.
i did check, and yes we were running the 6 defaults and with this config it goes up to 7. terminal output attached
$ make lint
( GOLANGCI_LINT_CACHE=/home/mike/dev/cluster-cloud-controller-manager-operator/.cache go run /home/mike/dev/cluster-cloud-controller-manager-operator/ve
ndor/github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout 10m -v)
INFO [config_reader] Config search paths: [./ /home/mike/dev/cluster-cloud-controller-manager-operator /home/mike/dev /home/mike /home /]
INFO [lintersdb] Active 6 linters: [errcheck gosimple govet ineffassign staticcheck unused]
INFO [loader] Go packages loading at mode 575 (files|types_sizes|compiled_files|exports_file|name|deps|imports) took 254.169292ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 2.518242ms
INFO [linters_context/goanalysis] analyzers took 0s with no stages
INFO [runner] Issues before processing: 6, after processing: 0
INFO [runner] Processors filtering stat (out/in): cgo: 6/6, path_prettifier: 6/6, skip_dirs: 6/6, exclude-rules: 1/6, filename_unadjuster: 6/6, autogene
rated_exclude: 6/6, skip_files: 6/6, identifier_marker: 6/6, exclude: 6/6, nolint: 0/1
INFO [runner] processing took 778.124µs with stages: nolint: 632.408µs, identifier_marker: 42.244µs, autogenerated_exclude: 29.122µs, path_prettifier: 2
8.022µs, exclude-rules: 22.503µs, skip_dirs: 20.094µs, cgo: 1.103µs, max_same_issues: 446ns, fixer: 324ns, diff: 293ns, filename_unadjuster: 290ns, seve
rity-rules: 264ns, exclude: 221ns, uniq_by_line: 178ns, skip_files: 170ns, max_from_linter: 96ns, source_code: 80ns, sort_results: 75ns, path_shortener:
70ns, max_per_file_from_linter: 64ns, path_prefixer: 57ns
INFO [runner] linters took 108.736888ms with stages: goanalysis_metalinter: 107.921807ms
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 5 samples, avg is 39.4MB, max is 67.2MB
INFO Execution took 368.213838ms
[mike@shift] update-fmt-and-imports ~/dev/cluster-cloud-controller-manager-operator
$ vim .golangci.yaml
[mike@shift] update-fmt-and-imports ~/dev/cluster-cloud-controller-manager-operator
$ make lint
( GOLANGCI_LINT_CACHE=/home/mike/dev/cluster-cloud-controller-manager-operator/.cache go run /home/mike/dev/cluster-cloud-controller-manager-operator/ve
ndor/github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout 10m -v)
INFO [config_reader] Config search paths: [./ /home/mike/dev/cluster-cloud-controller-manager-operator /home/mike/dev /home/mike /home /]
INFO [config_reader] Used config file .golangci.yaml
INFO [lintersdb] Active 7 linters: [errcheck goimports gosimple govet ineffassign staticcheck unused]
INFO [loader] Go packages loading at mode 575 (exports_file|imports|types_sizes|compiled_files|deps|files|name) took 279.585394ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 3.498925ms
INFO [linters_context/goanalysis] analyzers took 1m54.742755847s with top 10 stages: buildir: 1m40.24997572s, nilness: 3.396365699s, fact_deprecated: 2.
163002325s, inspect: 2.147753962s, printf: 1.451514392s, fact_purity: 1.357569133s, ctrlflow: 1.328747476s, SA5012: 1.031048598s, typedness: 1.022998892
s, goimports: 78.306231ms
INFO [runner] Issues before processing: 6, after processing: 0
INFO [runner] Processors filtering stat (out/in): cgo: 6/6, path_prettifier: 6/6, identifier_marker: 6/6, filename_unadjuster: 6/6, skip_dirs: 6/6, auto
generated_exclude: 6/6, exclude: 6/6, exclude-rules: 1/6, nolint: 0/1, skip_files: 6/6
INFO [runner] processing took 1.013784ms with stages: nolint: 786.051µs, identifier_marker: 64.982µs, autogenerated_exclude: 48.673µs, exclude-rules: 39
.219µs, path_prettifier: 39.024µs, skip_dirs: 31.36µs, cgo: 1.303µs, max_same_issues: 662ns, filename_unadjuster: 522ns, uniq_by_line: 271ns, fixer: 262
ns, skip_files: 247ns, diff: 204ns, sort_results: 191ns, source_code: 182ns, exclude: 182ns, severity-rules: 177ns, max_from_linter: 97ns, max_per_file_
from_linter: 66ns, path_shortener: 55ns, path_prefixer: 54ns
INFO [runner] linters took 8.004349264s with stages: goanalysis_metalinter: 8.003284359s
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 82 samples, avg is 3258.7MB, max is 6761.6MB
INFO Execution took 8.290421183s
This change removes the old goimports command execution in favor of using the golangci-lint configuration to include goimports. The fmt target is also updated to use the normal `go fmt` command.
0bae180
to
f56cd8f
Compare
updated to add default linters in the configuration |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JoelSpeed The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
42446fc
into
openshift:master
@elmiko: Jira Issue OCPBUGS-43157: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-43157 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@elmiko: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@elmiko: new pull request created: #371 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[ART PR BUILD NOTIFIER] Distgit: ose-cluster-cloud-controller-manager-operator |
This change removes the old goimports command execution in favor of using the golangci-lint configuration to include goimports. The fmt target is also updated to use the normal
go fmt
command.