Skip to content

Fix for issue 312: fixed clang-tidy linting warnings and error in include/* and src/*#310

Merged
PLeVasseur merged 5 commits intoeclipse-uprotocol:mainfrom
MaximilianToe:Issue_298_Clang_tidy_false_positives
Mar 20, 2025
Merged

Fix for issue 312: fixed clang-tidy linting warnings and error in include/* and src/*#310
PLeVasseur merged 5 commits intoeclipse-uprotocol:mainfrom
MaximilianToe:Issue_298_Clang_tidy_false_positives

Conversation

@MaximilianToe
Copy link
Contributor

@MaximilianToe MaximilianToe commented Mar 16, 2025

Fixed clang-tidy warnings and errors in all files contained in the include and src directories.
Also added the fixes suggested in Issue 264 and 270.
Additionally, updated and pinned clang-tidy version to 13 to make it consistent with the version of the clang compiler.
Lastly, modified the clang-tidy.sh script to only check include and src. Previously, this would check all files, including cmake files, etc.
The exact files to check should probably be discussed, and the script modified accordingly.

closes #312

changed const to const ref in validator/uuid

removed more linter warnings and errors

fixed more linting errors

linting fixes and pinned clang-tidy 13 in ci.yml

fixed more liting errors

fixed most warnings/errors except magic numbers and closure

fixed linting errors in RpcClient.cpp

fixed all errors, only warnings remainings

test pipeline

fixed all errors during build

fixed signature mismatch in header file

save

builds and all tests pass

replaced some magic numbers

fixed magic numbers in uuid.cpp

replaced all magic numbers

modified PendingRequest in RpcClient.cpp with public constructor

deleted unsued code

removed unused setters
@lammjo
Copy link

lammjo commented Mar 17, 2025

@PLeVasseur Would you be so kind to take a look at the PR and trigger the pipeline? Max is the colleague I told you about.

An open question is whether the test files should also be linted. Personally, I prefer linting tests as well. But since many of the warnings and errors in the tests are of a different nature than in the source files, I created a separate issue for these, #311, which we could tackle next.


pushd "$PROJECT_ROOT" > /dev/null
for f in **/*.h **/*.cpp; do
for f in include/**/*.h src/**/*.cpp; do # test/coverage/**/*.cpp test/extra/**/*.cpp test/include/**/*.h; do
Copy link

Choose a reason for hiding this comment

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

I believe there is no need to change the script in this way. If you want to limit the scope of the linter, you can provide the desired files explicitly.

Copy link

@lammjo lammjo Mar 17, 2025

Choose a reason for hiding this comment

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

version is redefined in line 439.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing this out. This should now be fixed.

@PLeVasseur PLeVasseur changed the title Fix for issue 298: fixed clang-tidy linting warnings and error in include/* and src/* Fix for issue 311: fixed clang-tidy linting warnings and error in include/* and src/* Mar 19, 2025
@PLeVasseur PLeVasseur changed the title Fix for issue 311: fixed clang-tidy linting warnings and error in include/* and src/* Fix for issue 312: fixed clang-tidy linting warnings and error in include/* and src/* Mar 19, 2025
@github-actions
Copy link

Code coverage report is ready! 📈

@PLeVasseur
Copy link
Contributor

Hi @MaximilianToe -- thank you for the contribution!

I noticed that there remained 10 or so warnings / errors in the include and src folders. Is it intended these be handled in this PR?

@MaximilianToe
Copy link
Contributor Author

Hi @MaximilianToe -- thank you for the contribution!

I noticed that there remained 10 or so warnings / errors in the include and src folders. Is it intended these be handled in this PR?

Hi @PLeVasseur,

Thank you for taking the time to review this PR. Sorry for the remaining errors, that was a mistake on my part. I forgot to run clang-format again before submitting the PR. I've now fixed the formatting and updated clang-format.sh to use clang-format 13.

I reran the CI pipeline to see if everything is fine now.
The only remaining warnings/errors should occur in the linting job for the test files, which I would leave to another PR.

@github-actions
Copy link

Code coverage report is ready! 📈

@PLeVasseur
Copy link
Contributor

Hi @MaximilianToe, thanks for the contribution!

The only remaining warnings/errors should occur in the linting job for the test files, which I would leave to another PR.

I confirmed that to be the case on the latest CI run. Great! I'll go review and approve.

Copy link
Contributor

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

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

Thanks again @MaximilianToe! I found one minor nit that I'll just go ahead and apply then merge.

@github-actions
Copy link

Code coverage report is ready! 📈

@PLeVasseur PLeVasseur merged commit 7ae7231 into eclipse-uprotocol:main Mar 20, 2025
11 of 12 checks passed
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.

Upgrade to clang-tidy-13, fix clang-tidy linting warnings and error in include/* and src/*

3 participants

Comments