Skip to content
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

Enabled gosimple linter. #5904

Merged
merged 1 commit into from
Dec 22, 2022
Merged

Enabled gosimple linter. #5904

merged 1 commit into from
Dec 22, 2022

Conversation

bendory
Copy link
Contributor

@bendory bendory commented Dec 20, 2022

Changes

This linter detects use of over-complex Go and suggests idiomatic replacements.

There are no functional changes expected in this PR.

Context: #5899

/kind cleanup

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • [N/A] Has Docs included if any changes are user facing
  • [N/A] Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • [N/A] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • [N/A] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 20, 2022
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/spire_mock.go 80.4% 81.1% 0.8

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/spire_mock.go 80.4% 81.1% 0.8

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 86.4% -2.5
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 86.4% -2.5
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

Copy link
Contributor

@ijschwabacher ijschwabacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth splitting the substantive test changes into a separate commit from the lint fixes.

pkg/spire/entrypointer.go Outdated Show resolved Hide resolved
pkg/spire/entrypointer.go Outdated Show resolved Hide resolved
pkg/spire/entrypointer.go Show resolved Hide resolved
pkg/spire/spire_test.go Outdated Show resolved Hide resolved
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@bendory
Copy link
Contributor Author

bendory commented Dec 21, 2022

It might be worth splitting the substantive test changes into a separate commit from the lint fixes.

Agreed, I'm splitting this into a separate PR which will follow this one.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

This linter detects use of over-complex Go and suggests idiomatic
replacements.

I cleaned up all the identified complexity.

There are no functional changes expected in this PR.

Note: I got frustrated with ~20s iterations of spire tests, so
I made the test timeout adjustable for faster iteration.

/kind cleanup
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@bendory
Copy link
Contributor Author

bendory commented Dec 21, 2022

It might be worth splitting the substantive test changes into a separate commit from the lint fixes.

Agreed, I'm splitting this into a separate PR which will follow this one.

That WIP is here and will be rebased after this PR is merged.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/bundle/resolver.go 95.8% 95.5% -0.4
pkg/resolution/resolver/cluster/resolver.go 84.4% 84.0% -0.3
pkg/resolution/resolver/git/resolver.go 84.1% 83.9% -0.2
pkg/resolution/resolver/hub/resolver.go 77.6% 77.2% -0.4
pkg/spire/entrypointer.go 88.9% 88.0% -0.9
pkg/spire/spire_mock.go 80.4% 80.6% 0.2

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lbernick

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 21, 2022
@bendory
Copy link
Contributor Author

bendory commented Dec 21, 2022

/assign @pritidesai

@abayer
Copy link
Contributor

abayer commented Dec 22, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 22, 2022
@tekton-robot tekton-robot merged commit db004eb into tektoncd:main Dec 22, 2022
@bendory bendory deleted the linters branch December 22, 2022 14:08
tekton-robot pushed a commit that referenced this pull request Dec 27, 2022
This PR is a follow-on from #5904 (comment)

There are no expected functional changes in this PR.

/kind cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants