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

ci: add golangci-lint workflow #448

Merged

Conversation

philipp-hinteregger
Copy link
Contributor

@philipp-hinteregger philipp-hinteregger commented Nov 21, 2022

This PR

  • introduces a new workflow for checking the code with golangci-lint
  • the following linters are being used
    • errcheck (default)
    • gosimple (default)
    • govet (default)
    • ineffassign (default)
    • staticcheck (default)
    • typecheck (default)
    • unused (default)
    • gofmt

Fixes

Follow up tasks

  • implement + refactor currently commented out linters

Signed-off-by: Philipp Hinteregger [email protected]

@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Merging #448 (f4e0580) into main (d4c6716) will increase coverage by 0.12%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #448      +/-   ##
==========================================
+ Coverage   43.16%   43.28%   +0.12%     
==========================================
  Files          27       27              
  Lines        2122     2116       -6     
==========================================
  Hits          916      916              
+ Misses       1124     1118       -6     
  Partials       82       82              
Impacted Files Coverage Δ
operator/controllers/common/activemetricsobject.go 70.00% <ø> (ø)
operator/controllers/common/metricsobject.go 100.00% <ø> (ø)
operator/controllers/common/phaseitem.go 95.16% <ø> (ø)
...or/controllers/keptnworkloadinstance/controller.go 49.46% <ø> (+2.28%) ⬆️
operator/webhooks/pod_mutating_webhook.go 35.94% <0.00%> (-0.28%) ⬇️
scheduler/pkg/klcpermit/workflow_manager.go 11.23% <0.00%> (ø)
Flag Coverage Δ
keptn-lifecycle-operator 47.81% <0.00%> (+0.15%) ⬆️
scheduler 4.52% <0.00%> (ø)

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

@philipp-hinteregger philipp-hinteregger force-pushed the ci/391/introduce-go-linters branch 2 times, most recently from 057868d to 5d1c1d6 Compare November 22, 2022 08:54
@philipp-hinteregger philipp-hinteregger marked this pull request as ready for review November 22, 2022 12:02
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
@philipp-hinteregger philipp-hinteregger force-pushed the ci/391/introduce-go-linters branch from 581f946 to 6cf8d2b Compare November 22, 2022 13:59
Signed-off-by: Philipp Hinteregger <[email protected]>
@thschue
Copy link
Contributor

thschue commented Nov 22, 2022

at the moment, many error checks are replaced by _`s ... I would prefer to implement proper error handling instead of this, as it makes sense in many cases ...

Signed-off-by: Philipp Hinteregger <[email protected]>
philipp-hinteregger and others added 3 commits November 23, 2022 08:44
Co-authored-by: Florian Bacher <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
Signed-off-by: Philipp Hinteregger <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@RealAnna RealAnna left a comment

Choose a reason for hiding this comment

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

LGTM

@philipp-hinteregger philipp-hinteregger merged commit 0855489 into keptn:main Nov 23, 2022
@philipp-hinteregger philipp-hinteregger deleted the ci/391/introduce-go-linters branch November 23, 2022 10:05
- name: "scheduler"
folder: "scheduler/"
steps:
- name: Check out code into the Go module directory
Copy link
Member

Choose a reason for hiding this comment

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

this name is maybe a bit misleading. what go module are we meaning here?

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.

5 participants