-
Notifications
You must be signed in to change notification settings - Fork 791
Add Clang tidy and many fixes #1047
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
15658a7
fix multiple issues with SimpleString
facontidavide 01d504c
add unit test
facontidavide 381612b
update copyright year
facontidavide 87b7bbe
add clang tidy and fix warnings
facontidavide 0bd6710
fix compilation in c++17
facontidavide db1b06f
apply the rulke of 5
facontidavide 1b40113
fix remaining warnings
facontidavide 5f890c9
run clang tidy in CI
facontidavide cbac2ce
fix
facontidavide bb90c6b
miscellaneus
facontidavide 0f37983
Entry should be non copyable
facontidavide c96a276
remove nolint
facontidavide 0af35ed
minor change
facontidavide File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| Checks: [ | ||
| "-*", | ||
| "bugprone-*", | ||
| "cert-*", | ||
| "clang-analyzer-*", | ||
| "concurrency-*", | ||
| "cppcoreguidelines-*", | ||
| "misc-*", | ||
| "modernize-*", | ||
| "performance-*", | ||
| "portability-*", | ||
| "readability-*", | ||
| "-bugprone-easily-swappable-parameters", | ||
| "-bugprone-narrowing-conversions", | ||
| "-cert-err58-cpp", | ||
| "-cppcoreguidelines-avoid-c-arrays", | ||
| "-cppcoreguidelines-avoid-magic-numbers", | ||
| "-cppcoreguidelines-avoid-non-const-global-variables", | ||
| "-cppcoreguidelines-non-private-member-variables-in-classes", | ||
| "-cppcoreguidelines-pro-bounds-array-to-pointer-decay", | ||
| "-cppcoreguidelines-pro-bounds-constant-array-index", | ||
| "-cppcoreguidelines-pro-bounds-pointer-arithmetic", | ||
| "-cppcoreguidelines-pro-type-const-cast", | ||
| "-cppcoreguidelines-pro-type-union-access", | ||
| "-cppcoreguidelines-pro-type-vararg", | ||
| "-misc-no-recursion", | ||
| "-misc-non-private-member-variables-in-classes" | ||
| ] | ||
|
|
||
|
|
||
| WarningsAsErrors: '-*,bugprone-*,cert-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,misc-*,portability-*,readability-implicit-bool-conversion,-concurrency-mt-unsafe,-readability-function-cognitive-complexity' | ||
|
|
||
| CheckOptions: | ||
| # ignore macros when computing the cyclomatic complexity. problem caused by RCLCPP LOG macros | ||
| - key: readability-function-cognitive-complexity.IgnoreMacros | ||
| value: 'true' | ||
|
|
||
| # This change makes it compatible with MISRA:2023 rule 4.14.1 | ||
| - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic | ||
| value: 'true' | ||
|
|
||
| # Making a copy of a shared_ptr has a non-zero cost, but this cost is small. | ||
| # Unfortunately the ROS API (subscriber callbacks) oblige the user to use callbacks functions that will trigger this warning | ||
| # This is the reason wht the warning is silenced here | ||
| - key: performance-unnecessary-value-param.AllowedTypes | ||
| value: 'std::shared_ptr' | ||
|
|
||
| # Reference: https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,29 @@ jobs: | |
| pre-commit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v3 | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| - uses: pre-commit/[email protected] | ||
|
|
||
| clang-tidy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install LLVM 21 | ||
| run: | | ||
| wget https://apt.llvm.org/llvm.sh | ||
| chmod +x llvm.sh | ||
| sudo ./llvm.sh 21 | ||
| sudo apt-get install -y clangd-21 clang-tidy-21 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libzmq3-dev libsqlite3-dev | ||
|
|
||
| - name: Configure CMake | ||
| run: cmake -B build -DBUILD_TESTING=OFF | ||
|
|
||
| - name: Run clang-tidy | ||
| run: ./run_clang_tidy.sh | ||
facontidavide marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.