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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 Add args to golangci-lint to show lines number #2180

Merged
merged 1 commit into from Aug 8, 2023

Conversation

lubronzhan
Copy link
Contributor

What this PR does / why we need it:
Right now the error doesn't show exact line that has issue.
With this fix, then the error log will be more descriptive.
Example: here https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/actions/runs/5791075333/job/15695267905?pr=2171

run golangci-lint
  Running [/home/runner/golangci-lint-1.53.3-linux-amd64/golangci-lint run --out-format=line-number,github-actions] in [] ...
  Error: pkg/session/session.go:335:67: unnecessary conversion (unconvert)
  		logger.V(4).Info("Session.LoginByToken with certificate", string(userCert))
  		                                                                ^
  pkg/session/session.go:347: unnecessary trailing newline (whitespace)
  
  }
  Error: unnecessary conversion (unconvert)
  Error: unnecessary trailing newline (whitespace)
  
  Error: issues found
  Ran golangci-lint in 2717ms

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes ##2058

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 8, 2023
@lubronzhan lubronzhan changed the title Add args to golangci-lint to show lines number 馃尡 Add args to golangci-lint to show lines number Aug 8, 2023
@sbueringer
Copy link
Member

Q: Do the PR annotations still work with this flag?

Possibly related: there was some work in golangci-lint to allow multiple format: golangci/golangci-lint-action#362 (comment) (IIRC)

@lubronzhan
Copy link
Contributor Author

Looks like it will, now it supports several output, if output doesn't contain github-action it will append automatically.

The PR that fixed 362 actually is just adding output-format flag golangci/golangci-lint-action#769

@sbueringer
Copy link
Member

Sounds good. Thx for looking into it.

Let's give it a try

@sbueringer
Copy link
Member

/lgtm

/assign @killianmuldoon
@killianmuldoon once we verified it works after merge. Can you please add the same in core CAPI?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 8, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e1558c9e02e18ca2bd1874749b501f3972503251

@killianmuldoon
Copy link
Contributor

@killianmuldoon once we verified it works after merge. Can you please add the same in core CAPI?

Will do

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: killianmuldoon

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 8, 2023
@k8s-ci-robot k8s-ci-robot merged commit 2b87dfe into kubernetes-sigs:main Aug 8, 2023
8 of 9 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.8 milestone Aug 8, 2023
@lubronzhan lubronzhan deleted the fix-2058 branch August 8, 2023 16:42
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 15, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 16, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
chrischdi pushed a commit to chrischdi/cluster-api-provider-vsphere that referenced this pull request Aug 16, 2023
- Add args to golangci-lint to show lines number kubernetes-sigs#2180
- Align github actions with upstream CAPI kubernetes-sigs#2167
- flavorgen generates all flavors by default kubernetes-sigs#2172
  - only CI parts
- Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174
- Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211
- Add doctoc and generate + verify targets kubernetes-sigs#2147
  - only CI parts
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants