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

Remove all clang tidy warnings from the core library of Lethe #1243

Merged
merged 11 commits into from
Aug 20, 2024

Conversation

blaisb
Copy link
Contributor

@blaisb blaisb commented Aug 16, 2024

Description

Since I have deployed the new CI action, we are able to identify many more alerts using clang sanitizer. This PR aims at removing the alerts from the core library of Lethe. We still have warnings when we compile with clang, but this will need an additional CI instance check.

Testing

All units tests and application tests should pass before this is merged.

Code related list:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Lethe documentation is up to date
  • The branch is rebased onto master
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent
  • If parameters are modified, the tests and the documentation of examples are up to date
  • [] Changelog (CHANGELOG.md) is up to date if the refactor affects the user experience or the codebase

Pull request related list:

  • No other PR is open related to this refactoring
  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
  • If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
  • If any future works is planed, an issue is opened
  • The PR description is cleaned and ready for merge

@blaisb blaisb added WIP When a PR is open but not ready for review Refactoring This PR is only refactoring or clean up labels Aug 16, 2024
@blaisb blaisb force-pushed the core_fix_warnings branch 2 times, most recently from 1f8eb28 to 881f23b Compare August 20, 2024 18:18
@blaisb blaisb changed the title [WIP] Remove all warnings from the core library of Lethe [WIP] Remove all clang tidy warnings from the core library of Lethe Aug 20, 2024
@blaisb blaisb changed the title [WIP] Remove all clang tidy warnings from the core library of Lethe Remove all clang tidy warnings from the core library of Lethe Aug 20, 2024
@blaisb blaisb requested review from AmishgaAlphonius and removed request for AmishgaAlphonius August 20, 2024 18:33
@blaisb blaisb added Ready for review and removed WIP When a PR is open but not ready for review labels Aug 20, 2024
@hepap hepap self-requested a review August 20, 2024 19:10
Copy link
Collaborator

@hepap hepap left a comment

Choose a reason for hiding this comment

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

Really nice to have that now!

This PR corrects all the warning in core from clang tidy. I saw other places that could be changed in the code, but they were not flag by the CI. I will push them tomorrow or Thursday.

@@ -291,7 +291,7 @@ fill_vectors_from_file(std::map<std::string, std::vector<double>> &map,
line_of_data = Utilities::string_to_double(list_of_words_clean);
for (unsigned int i = 0; i < line_of_data.size(); ++i)
{
map[column_names[i]].push_back(line_of_data[i]);
map[column_names[i]].emplace_back(line_of_data[i]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the advantage of using emplace_back here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like we discussed :) prevents the generation of a copy.

@blaisb blaisb merged commit afe7dbb into master Aug 20, 2024
10 of 11 checks passed
@blaisb blaisb deleted the core_fix_warnings branch August 20, 2024 21:12
blaisb added a commit that referenced this pull request Aug 27, 2024
Description
This is a follow up to #1243 but for the solvers library.

Testing
All tests should pass.
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
…polymtl#1243)

Description
Since I have deployed the new CI action, we are able to identify many more alerts using clang sanitizer. This PR aims at removing the alerts from the core library of Lethe. We still have warnings when we compile with clang, but this will need an additional CI instance check.

Testing
All units tests and application tests should pass before this is merged.

Former-commit-id: afe7dbb
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Description
This is a follow up to chaos-polymtl#1243 but for the solvers library.

Testing
All tests should pass.

Former-commit-id: 65020c6
blaisb added a commit that referenced this pull request Sep 30, 2024
Description
Since I have deployed the new CI action, we are able to identify many more alerts using clang sanitizer. This PR aims at removing the alerts from the core library of Lethe. We still have warnings when we compile with clang, but this will need an additional CI instance check.

Testing
All units tests and application tests should pass before this is merged.

Former-commit-id: afe7dbb
blaisb added a commit that referenced this pull request Sep 30, 2024
Description
This is a follow up to #1243 but for the solvers library.

Testing
All tests should pass.

Former-commit-id: 65020c6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for review Refactoring This PR is only refactoring or clean up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants