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

clang-tidy add const to methods and replace size() == 0 with empty #5673

Merged
merged 8 commits into from
Nov 29, 2021

Conversation

timosachsenberg
Copy link
Contributor

@timosachsenberg timosachsenberg commented Nov 23, 2021

Description

readability-container-size-empty
readability-make-member-function-const

Checklist:

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes. (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI:

If your PR is failing you can check out

Note:

  • Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).

@timosachsenberg timosachsenberg marked this pull request as draft November 23, 2021 22:21
@timosachsenberg timosachsenberg marked this pull request as ready for review November 24, 2021 15:43
@timosachsenberg timosachsenberg changed the title add const to methods and replace size() == 0 with empty clang-tidy add const to methods and replace size() == 0 with empty Nov 24, 2021
@timosachsenberg
Copy link
Contributor Author

also get a failed compile here:
E:\jenkins\ws\openms\PR\bldtst\9447518b\source\src\openms_gui\include\OpenMS/VISUAL/APPLICATIONS/TOPPViewBase.h(247,39): error C2556: 'OpenMS::LayerData *OpenMS::TOPPViewBase::getCurrentLayer(void) const': overloaded function differs only by return type from 'const OpenMS::LayerData *OpenMS::TOPPViewBase::getCurrentLayer(void) const'

@timosachsenberg
Copy link
Contributor Author

rebuild jenkins

@timosachsenberg
Copy link
Contributor Author

compiles on gitpod... let's see who complains

@timosachsenberg
Copy link
Contributor Author

ok there seem still to be some of the .empty() vs default constructor tests... will fix them

@timosachsenberg
Copy link
Contributor Author

Tests passed now

Copy link
Contributor

@cbielow cbielow left a comment

Choose a reason for hiding this comment

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

i cannot look at ... !empty() anymore :)

@timosachsenberg
Copy link
Contributor Author

i cannot look at ... !empty() anymore :)

Better than size() > 0 though ;)

@timosachsenberg timosachsenberg merged commit a105524 into develop Nov 29, 2021
@timosachsenberg timosachsenberg deleted the feature/add_const_and_empty branch November 29, 2021 20:19
@timosachsenberg
Copy link
Contributor Author

Thanks for taking the time to go through it. It is tiring I admit…

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.

None yet

2 participants