Skip to content

Conversation

@runcom
Copy link
Member

@runcom runcom commented Apr 3, 2019

Signed-off-by: Antonio Murdaca [email protected]

- What I did

Add https://github.com/golangci/golangci-lint to our verify target and fix all the current warnings to start fresh once this PR merges. The linter binary is already go get'ed with openshift/release#3332

closes #447

- How to verify it

CI

- Description for the changelog

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 3, 2019
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 3, 2019
@runcom
Copy link
Member Author

runcom commented Apr 3, 2019

/hold

since there a bunch of stuff to be fixed

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 3, 2019
@runcom
Copy link
Member Author

runcom commented Apr 3, 2019

oh cool, verify it's working already 😍

@kikisdeliveryservice
Copy link
Contributor

i love this!!

@cgwalters
Copy link
Member

Oh hum...we probably should have noticed the MCO was using md5 earlier 😢
Not totally sure if we can change it now easily.

@runcom
Copy link
Member Author

runcom commented Apr 3, 2019

Yeah, I'm not sure about even landing this for 4.1 due to the many stuff to take care of but still. Now we noticed and we can think about migrating/fixing some of this stuff.

@runcom
Copy link
Member Author

runcom commented Apr 4, 2019

made another pass at this, changes are trivial though

@runcom runcom force-pushed the linters branch 2 times, most recently from 5108719 to db00105 Compare April 4, 2019 08:57
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 4, 2019
@runcom runcom force-pushed the linters branch 2 times, most recently from 9ab5d36 to 9b4374b Compare April 4, 2019 09:06
@runcom runcom changed the title WIP: add golangci-lint add golangci-lint Apr 4, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 4, 2019
@runcom
Copy link
Member Author

runcom commented Apr 4, 2019

Removed WIP, some linters are disabled or this PR becomes a never ending PR. After this merges, I'll open an issue for contributors and us to re-enable and fix the remaining disabled linters.

Still on hold cause #603 since it's the last error for this

@ashcrow
Copy link
Member

ashcrow commented Apr 4, 2019

golangci-lint run
2019/04/04 09:20:21 unknown architecture wasm
pkg/controller/kubelet-config/kubelet_config_controller.go:335:67: `(*Controller).syncStatusOnly` - `err` is unused (unparam)
func (ctrl *Controller) syncStatusOnly(cfg *mcfgv1.KubeletConfig, err error, args ...interface{}) error {

@runcom
Copy link
Member Author

runcom commented Apr 4, 2019

golangci-lint run
2019/04/04 09:20:21 unknown architecture wasm
pkg/controller/kubelet-config/kubelet_config_controller.go:335:67: (*Controller).syncStatusOnly - err is unused (unparam)
func (ctrl *Controller) syncStatusOnly(cfg *mcfgv1.KubeletConfig, err error, args ...interface{}) error {

#600 (comment)

@runcom
Copy link
Member Author

runcom commented Apr 10, 2019

This requires #618 in order to be consistent

/hold

@runcom
Copy link
Member Author

runcom commented Apr 10, 2019

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 10, 2019
@droslean
Copy link
Member

/test verify

@runcom
Copy link
Member Author

runcom commented Apr 10, 2019

/test verify

this is not gonna pass as we aren't and we won't be at 1.11 for now

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 15, 2019
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 15, 2019
@runcom
Copy link
Member Author

runcom commented May 15, 2019

depends on openshift/release#3799

Makefile Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

@runcom qq - is it bound to a particular release ?

Copy link
Contributor

Choose a reason for hiding this comment

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

i suspect it is by looking https://github.com/openshift/release/pull/3799/files so maybe the echo can be extended to mention that ... my 0.02$ though

Copy link
Member Author

Choose a reason for hiding this comment

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

closed that PR as it's not needed now that we're all above go1.10 (1.12 to be precise)

Choose a reason for hiding this comment

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

How about adding a target to install it for you? e.g.

$(GOBIN)/golangci-lint: 
	go get -u github.com/golangci/golangci-lint/cmd/golangci-lint

verify: $(GOBIN)/golangci-lint

Copy link
Member Author

Choose a reason for hiding this comment

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

I've gona back and forth on the target (we used to have it in CRI-O as well but ended up being dropped cause the CI was taking care of it https://github.com/cri-o/cri-o/pull/2247/files#diff-b67911656ef5d18c4ae36cb6741b7965L308)

The real pain with go1.12 and onwards would be modules also (and calculating $GOBIN). I'm not yet familiar with that. I'm super fine following up to this and add targets to install tools also 👍

Choose a reason for hiding this comment

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

👍 I guess I'm used to having a golang version check to handle compatibility. there were issues with GOBIN? never come across that myself.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess I'm used to having a golang version check to handle compatibility.

oh cool, that might be something useful to have here in MCO as well :)

there were issues with GOBIN? never come across that myself.

afaict with go modules, go build creates binaries in PWD so that must be conditionalized as well (hence your suggestion above to version check is amazing)

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 15, 2019
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 12, 2019
@runcom
Copy link
Member Author

runcom commented Jun 12, 2019

This is good to go now

@runcom
Copy link
Member Author

runcom commented Jun 12, 2019

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 12, 2019
@runcom runcom removed the 4.2 label Jun 12, 2019
.golangci.yml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

we definitely want to exclude unit test files from linting? Just double checking.

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, but as with the other "ignored" linters in this file, we might want, at some point, remove this and fix everything. Right now we need to get this in and fix code (not tests) to have this run and check on every PR w/o asking ppl to gofmt as you noticed.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok sounds good

Fix all the current warnings as well

Signed-off-by: Antonio Murdaca <[email protected]>
@runcom
Copy link
Member Author

runcom commented Jun 13, 2019

rebased again 😄

@kikisdeliveryservice
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 13, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kikisdeliveryservice, runcom

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [kikisdeliveryservice,runcom]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 0d843aa into openshift:master Jun 13, 2019
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. lgtm Indicates that a PR is ready to be merged. 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.

Add static checks to the project in PRs