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

chore: enable unnecessary-stmt from revive #21398

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

mmorel-35
Copy link
Contributor

Description

unnecessary-stmt: This rule suggests to remove redundant statements like a break at the end of a case block, for improving the code's readability.

@mmorel-35 mmorel-35 requested a review from a team as a code owner January 7, 2025 07:30
Copy link

bunnyshell bot commented Jan 7, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 55.25%. Comparing base (c739478) to head (5e02af9).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
cmd/argocd/commands/admin/backup.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21398      +/-   ##
==========================================
+ Coverage   55.16%   55.25%   +0.08%     
==========================================
  Files         337      337              
  Lines       57039    57034       -5     
==========================================
+ Hits        31464    31512      +48     
+ Misses      22874    22825      -49     
+ Partials     2701     2697       -4     

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

}
if issuedAtTime, err := jwtutil.IssuedAtTime(claims); err == nil {
rvalsStrs = append(rvalsStrs, "iat: "+issuedAtTime.Format(time.RFC3339))
if err == nil {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if err == nil {
if err == nil {

we should also check for the case when err is non-nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you suggest here ?

Copy link
Member

Choose a reason for hiding this comment

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

I think the change is fine, although it reads a little weird. Looks functionally identical to before.

Copy link
Member

@nitishfy nitishfy left a comment

Choose a reason for hiding this comment

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

PTAL.

@crenshaw-dev crenshaw-dev merged commit 50c49ec into argoproj:master Jan 7, 2025
27 checks passed
@mmorel-35 mmorel-35 deleted the revive/unnecessary-stmt branch January 7, 2025 15:00
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.

3 participants