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

Fixing code style #377

Merged

Conversation

rluders
Copy link
Contributor

@rluders rluders commented Mar 18, 2021

This PR fixes some code styling issues, based on the linting tool report.

Categories

  • Bugfix
  • Enhancement
  • Backporting
  • Others (CI, Infrastructure, Documentation)

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

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 18, 2021
@openshift-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 18, 2021
t.Fatalf("the expected intervals didn't match actual intervals. \nExpected %v \nActual %v", setIntervals, actualIntervals)
}
}

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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 :)

Copy link
Contributor Author

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
}
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, wait! Wrong operator. 🤦

@rluders rluders marked this pull request as ready for review March 19, 2021 08:26
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2021
@rluders rluders requested a review from tremes March 19, 2021 08:46
@0sewa0
Copy link
Contributor

0sewa0 commented Mar 19, 2021

+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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2021
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit f4f45bc into openshift:master Mar 19, 2021
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants