-
Notifications
You must be signed in to change notification settings - Fork 98
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
Fixing code style #377
Fixing code style #377
Conversation
Skipping CI for Draft Pull Request. |
t.Fatalf("the expected intervals didn't match actual intervals. \nExpected %v \nActual %v", setIntervals, actualIntervals) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you removing all this? I know it's ignored, but I don't see any harm in leaving it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused code should be always removed, we are using version control to handle it to us. So, no need to keep it in the repository, a few enumerated reasons related to code quality:
- "Out of sight" is also "Out of mind";
- Reduce the code base size;
- Version control handles it and keeps it forever;
- Lint will always complain about unused functions, variables, etc;
There are also few articles about it:
https://www.infoq.com/news/2017/02/dead-code/
https://blog.ndepend.com/no-excuse-dead-code/
https://www.oreilly.com/library/view/becoming-a-better/9781491905562/ch04.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK then it would be good to fix the test or at least create some tracking issue, because "Out of sight" is also "Out of mind" as you said :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create an issue to review this test.
// just to make lint happy | ||
if cm != nil { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct. I think we want to continue in the test when cm != nil
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wait! Wrong operator. 🤦
+1 from me, love to see the removal of dead code. Also the consistency the linting will bring will be a breath of fresh air. :) /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 0sewa0, rluders 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 |
This PR fixes some code styling issues, based on the linting tool report.
Categories
Sample archive
No.
Documentation
No.
Unit Tests
It doesn't include any tests, but most lint issues were related to it.
Privacy
Yes. There are no sensitive data in the newly collected information.
Changelog
No.
References
https://issues.redhat.com/browse/CCXDEV-4079