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

feat(perf): add new linter prealloc to enforce slice declarations best practice #10250

Merged
merged 6 commits into from
May 20, 2024

Conversation

realshuting
Copy link
Member

@realshuting realshuting commented May 17, 2024

Explanation

This PR adds the linter https://github.com/alexkohler/prealloc to enforce slice definition best pracitices.

Related issue

Milestone of this PR

Documentation (required for features)

My PR contains new or altered behavior to Kyverno.

What type of PR is this

Proposed Changes

Proof Manifests

Checklist

  • I have read the contributing guidelines.
  • I have read the PR documentation guide and followed the process including adding proof manifests to this PR.
  • This is a bug fix and I have added unit tests that prove my fix is effective.
  • This is a feature and I have added CLI tests that are applicable.
  • My PR needs to be cherry picked to a specific release branch which is .
  • My PR contains new or altered behavior to Kyverno and
    • CLI support should be added and my PR doesn't contain that functionality.

Further Comments

…t practice

Signed-off-by: ShutingZhao <shuting@nirmata.com>
@realshuting realshuting changed the title feat(perf): add new linter prealloc to enforce slice declarations best practice feat(perf): add new linter prealloc to enforce slice declarations best practice May 17, 2024
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 47.82609% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 10.18%. Comparing base (46e5d81) to head (2e8768d).

Files Patch % Lines
pkg/validatingadmissionpolicy/version_converter.go 0.00% 7 Missing ⚠️
pkg/controllers/webhook/controller.go 0.00% 2 Missing ⚠️
...cli/kubectl-kyverno/commands/fix/policy/options.go 0.00% 1 Missing ⚠️
.../cli/kubectl-kyverno/commands/json/scan/options.go 0.00% 1 Missing ⚠️
cmd/cli/kubectl-kyverno/commands/test/command.go 0.00% 1 Missing ⚠️
cmd/cli/kubectl-kyverno/commands/test/test.go 0.00% 1 Missing ⚠️
cmd/cli/kubectl-kyverno/fix/test.go 0.00% 1 Missing ⚠️
cmd/cli/kubectl-kyverno/processor/vap_processor.go 0.00% 1 Missing ⚠️
...tl-kyverno/utils/common/kyverno_resources_types.go 0.00% 1 Missing ⚠️
...rno/utils/common/validating_admission_resources.go 0.00% 1 Missing ⚠️
... and 7 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10250   +/-   ##
=======================================
  Coverage   10.18%   10.18%           
=======================================
  Files        1030     1030           
  Lines       91839    91839           
=======================================
  Hits         9356     9356           
  Misses      81460    81460           
  Partials     1023     1023           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: ShutingZhao <shuting@nirmata.com>
@realshuting
Copy link
Member Author

/cherry-pick release-1.12

@realshuting realshuting added this to the Kyverno Release 1.12.2 milestone May 20, 2024
Copy link
Member

@vishal-chdhry vishal-chdhry left a comment

Choose a reason for hiding this comment

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

lgtm

@realshuting realshuting merged commit fb9c66f into kyverno:main May 20, 2024
249 of 250 checks passed
Copy link

Cherry-pick failed with Merge error fb9c66f455379f3144277e045a7071d2f85ae8db into temp-cherry-pick-4ae1d3-release-1.12

realshuting added a commit to realshuting/kyverno that referenced this pull request May 20, 2024
Signed-off-by: ShutingZhao <shuting@nirmata.com>
@realshuting realshuting added the cherry-pick-completed The PR was cherry-picked (or merged) to required release branches label May 20, 2024
realshuting added a commit that referenced this pull request May 20, 2024
Signed-off-by: ShutingZhao <shuting@nirmata.com>
anushkamittal2001 pushed a commit to nirmata/kyverno that referenced this pull request May 24, 2024
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-completed The PR was cherry-picked (or merged) to required release branches cherry-pick-required milestone 1.12.2 milestone 1.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants