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 - apply #326

Merged
merged 25 commits into from
Nov 7, 2024
Merged

Clang tidy - apply #326

merged 25 commits into from
Nov 7, 2024

Conversation

sven-oly
Copy link
Collaborator

@sven-oly sven-oly commented Oct 10, 2024

Applied

clang-tidy --checks='modernize*, readability*, clang-analyzer-apiModeling'  *.cpp --fix-errors

Note that this does not yet apply clang-tidy in the continuous integration. This might be done with this GitHub action: https://github.com/HorstBaerbel/action-clang-tidy

References:
https://www.kdab.com/clang-tidy-part-1-modernize-source-code-using-c11c14/

https://www.electronjs.org/docs/latest/development/clang-tidy
https://www.wholetomato.com/blog/2021/01/08/a-brief-introduction-to-clang-tidy-and-its-role-in-visual-assist/

@sven-oly
Copy link
Collaborator Author

This address #234

@sven-oly
Copy link
Collaborator Author

Please take a look at these updates for CPP code.

@echeran
Copy link
Collaborator

echeran commented Nov 5, 2024

Here's another clang-tidy CI action that builds upon the previously suggested one with inline comments in the review:
https://github.com/marketplace/actions/clang-tidy-review

@echeran
Copy link
Collaborator

echeran commented Nov 6, 2024

After creating the compile_commands.txt file, then I can point to the directory that contains it in the clang-tidy command as so, using the -p flag:

clang-tidy  *.cpp --fix-errors --header-filter='.*' -p .

(this example presupposes that the command is being issued from the same directory as compile_commands.txt)

Copy link
Collaborator

@echeran echeran left a comment

Choose a reason for hiding this comment

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

LGTM

@echeran
Copy link
Collaborator

echeran commented Nov 6, 2024

The command to run clang-tidy locally, as mentioned in the comments in the CI workflow file, is:

clang-tidy  *.cpp --fix-errors --config-file="clang-tidy-config.yml" -p .

@sven-oly sven-oly merged commit b3900bc into unicode-org:main Nov 7, 2024
6 checks passed
@sven-oly sven-oly deleted the clang_tidy branch November 7, 2024 00:56
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.

2 participants