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

Add revive to golanci #37

Conversation

bshewale
Copy link
Contributor

This PR replace deprecated go-linter using
revive (https://golangci-lint.run/usage/linters/#revive).

We will add "ginkgolinter" in follow up patch once we merged add pre-commit job in openshift/releases.

If we add "ginkgolinter" in this patch then it's causes below issue 1

level=info msg="[config_reader] Config search paths: [./ /home/prow/go/src/github.com/openstack-k8s-operators/dataplane-operator /home/prow/go/src/github.com/openstack-k8s-operators /home/prow/go/src/github.com /home/prow/go/src /home/prow/go /home/prow /home /]"
level=info msg="[config_reader] Used config file .golangci.yaml"
level=error msg="Running error: unknown linters: 'ginkgolinter', run 'golangci-lint help linters' to see the list of supported linters"

This patch also Remove fmt dependency from make tidy as per 2:

The fmt dependency cannot be run if the go.mod file needs an update:

 $ make tidy
 go fmt ./...
 go: updates to go.mod needed; to update it:
        go mod tidy
 make: *** [Makefile:103: fmt] Error 1

I have also made some changes as per the comment given here 3

@openshift-ci openshift-ci bot requested review from dprince and stuggi April 10, 2023 09:38
@bshewale bshewale force-pushed the enable-new-linters branch 2 times, most recently from 68d70dc to a8e843b Compare April 13, 2023 13:42
@nunnatsa
Copy link

nunnatsa commented Apr 16, 2023

Hi. I'm the writer of ginkgolinter and I see here it's not working for you, and I would like to help you with it, if you want.

I wonder how the pre-commit is working. Is it running the configuration from the main branch, or from the PR? Because ginkgolinter is a bit new in golangci-lint, maybe, if the pre-commit uses the main branch configuration, it's using an old version of golangci-lint, that does not contain the new linter, yet? even the old version will read the .golangci.yml file and will find the ginkgolinter there. The version in this PR (v1.52.2) should contain it.

This PR replace deprecated go-linter using
revive (https://golangci-lint.run/usage/linters/#revive).

We will add "ginkgolinter" in follow up patch once we merged add pre-commit job in openshift/releases.

If we add "ginkgolinter" in this patch then it's causes below issue [1]

```
level=info msg="[config_reader] Config search paths: [./ /home/prow/go/src/github.com/openstack-k8s-operators/dataplane-operator /home/prow/go/src/github.com/openstack-k8s-operators /home/prow/go/src/github.com /home/prow/go/src /home/prow/go /home/prow /home /]"
level=info msg="[config_reader] Used config file .golangci.yaml"
level=error msg="Running error: unknown linters: 'ginkgolinter', run 'golangci-lint help linters' to see the list of supported linters"
```

This patch also Remove fmt dependency from make tidy as per [2]:

The fmt dependency cannot be run if the go.mod file needs an update:
```
 $ make tidy
 go fmt ./...
 go: updates to go.mod needed; to update it:
        go mod tidy
 make: *** [Makefile:103: fmt] Error 1
```

I have also made some changes as per the comment given here [3]

[1]: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openstack-k8s-operators_dataplane-operator/147/pull-ci-openstack-k8s-operators-dataplane-operator-main-golangci/1643555465537261568/artifacts/test/build-log.txt
[2]: openstack-k8s-operators/placement-operator#153
[3]: openstack-k8s-operators/cinder-operator#147 (comment)
@viroel
Copy link
Contributor

viroel commented Apr 17, 2023

/test precommit-check

@viroel
Copy link
Contributor

viroel commented Apr 17, 2023

@stuggi this is one ready, ptal when you have some time, thanks.

Copy link
Contributor

@abays abays left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, bshewale

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

@openshift-merge-robot openshift-merge-robot merged commit 8332cc7 into openstack-k8s-operators:main Apr 17, 2023
Comment on lines +360 to 362
endpoint.EndpointAdmin: {
Port: designate.DesignateAdminPort,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

for all other services we stopped creating the admin endpt, e.g. https://github.com/openstack-k8s-operators/placement-operator/blob/master/controllers/placementapi_controller.go#L328-L334 . @weinimo ok to not have the admin endpt for designate?

Copy link
Contributor

Choose a reason for hiding this comment

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

@dkehn what do you think?
(Sorry, I am not very familiar with Designate's design)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants