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

Use "revive" instead of "golint" linter #1316

Merged
merged 1 commit into from
May 21, 2021

Conversation

willbeason
Copy link
Member

@willbeason willbeason commented May 20, 2021

What this PR does / why we need it:

Per the golint repository, the golint linter is no longer maintained.
The recommended golangci-lint replacement is revive, so this PR switches
us to use the new linter. This commit also includes all necessary
changes to make the new linter pass.

In configuring this I noticed the that our .golangci.yaml had a typo
which caused our misspell and lll configurations to be silently
discarded - I've corrected "linter" to "linters" and resolved the
spelling mistakes it found.

Note: when running locally, you may need to upgrade to golangci-lint
1.40.1 as some previous versions did not properly configure gosec.

Signed-off-by: Will Beason willbeason@google.com

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2021

Codecov Report

Merging #1316 (3270333) into master (a2a42df) will increase coverage by 0.14%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1316      +/-   ##
==========================================
+ Coverage   48.52%   48.67%   +0.14%     
==========================================
  Files          68       68              
  Lines        4894     4890       -4     
==========================================
+ Hits         2375     2380       +5     
+ Misses       2166     2160       -6     
+ Partials      353      350       -3     
Flag Coverage Δ
unittests 48.67% <75.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
apis/status/v1beta1/constraintpodstatus_types.go 81.81% <ø> (ø)
apis/status/v1beta1/mutatorpodstatus_types.go 80.95% <ø> (ø)
pkg/controller/sync/stats_reporter.go 64.00% <ø> (ø)
pkg/mutation/match/match.go 85.71% <ø> (ø)
pkg/mutation/mutators/assign_mutator.go 51.89% <0.00%> (ø)
pkg/mutation/path/parser/node.go 76.00% <ø> (ø)
pkg/mutation/path/token/token.go 0.00% <ø> (ø)
pkg/operations/operations.go 53.57% <ø> (ø)
pkg/readiness/ready_tracker.go 70.89% <ø> (ø)
pkg/syncutil/context.go 0.00% <ø> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2a42df...3270333. Read the comment docs.

@willbeason willbeason force-pushed the revive branch 2 times, most recently from 3e75a12 to fee30b8 Compare May 20, 2021 16:35
@@ -1,17 +1,23 @@
linter-settings:
linters-settings:
Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM with one nit

pkg/controller/config/process/excluder.go Outdated Show resolved Hide resolved
@sozercan
Copy link
Member

Looks like git diff fails. Can you run make manifests?

@willbeason
Copy link
Member Author

Looks like git diff fails. Can you run make manifests?

Ahh, that's it. Done!

Per the golint repository, the golint linter is no longer maintained.
The recommended golangci-lint replacement is revive, so this PR switches
us to use the new linter. This commit also includes all necessary
changes to make the new linter pass.

In configuring this I noticed the that our .golangci.yaml had a typo
which caused our misspell and lll configurations to be silently
discarded - I've corrected "linter" to "linters" and resolved the
spelling mistakes it found.

Also upgrade golangci-lint from 1.37.1 to 1.40.1 as previous versions
did not configure gosec properly.

Signed-off-by: Will Beason <willbeason@google.com>
@sozercan sozercan merged commit e09498c into open-policy-agent:master May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants