-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
ci: enable bugprone-* warnings in clang-tidy #5543
Conversation
Signed-off-by: Ryuta Kambe <[email protected]>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Could you provide the exact steps for me to replicate and test this PR on my local machine? (you can skip the git checkout parts) |
Sure!!
As I have written in Notes, this command takes much long time (some hours in my env)... |
@veqcc -san I will test this today, sorry for being late. |
Hello @veqcc -san, thank you for providing the steps. Only difference is I build with I followed them but got all these errors: https://gist.github.com/xmfcx/9c51facc1147f0ea9734bd1b91a02db2 Am I missing something? I've also checked https://github.com/autowarefoundation/autoware-github-actions/blob/main/clang-tidy/action.yaml and couldn't figure out what might me missing. I am on Ubuntu 22.04 and installed My .bashrc has: # Ccache
export CC="/usr/lib/ccache/gcc"
export CXX="/usr/lib/ccache/g++"
export CCACHE_DIR="$HOME/.cache/ccache/" I wonder if this might have caused it 🤔 |
Somehow, clang-tidy seems not recognizing C++ headers 🥹
So the
|
Signed-off-by: Ryuta Kambe <[email protected]>
@xmfcx |
In the latest main of current time, this has passed with the following mods: My Checks: "
-*,
bugprone-*,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-infinite-loop,
-bugprone-integer-division,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-parent-virtual-call,
-bugprone-reserved-identifier,
-bugprone-signed-char-misuse"
WarningsAsErrors: "*"
ExtraArgs:
- -std=c++17
- -Wno-c11-extensions
- -I/usr/include/c++/11
- -I/usr/include/x86_64-linux-gnu/c++/11 # I have these in my .bashrc
export CC="/usr/lib/ccache/gcc"
export CXX="/usr/lib/ccache/g++"
export CCACHE_DIR="$HOME/.cache/ccache/"
export CMAKE_EXPORT_COMPILE_COMMANDS=1
# Install stuff
sudo apt update
sudo apt install clang-tidy libomp-dev
# Commands
colcon build --symlink-install --event-handlers=console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
export FILES=($(find src/universe/autoware.universe/ -name '*.cpp' -not -path '*/test/*' -not -path '*/examples/*'))
run-clang-tidy -j $(nproc) -p build/ "${FILES[@]}" To measure the time it took, I ran it with: time run-clang-tidy -j $(nproc) -p build/ "${FILES[@]}" And it took about 11mins. (I was using a 5900x 12c24t cpu)
Results(no errors): https://gist.github.com/xmfcx/0733a689acdf7cfb4479a4e118b5bfdd 🎊 |
* feat(.github): push version tag images (autowarefoundation#5522) * add tag pattern Signed-off-by: Yutaka Kondo <[email protected]> * fix syntax Signed-off-by: Yutaka Kondo <[email protected]> * add tags Signed-off-by: Yutaka Kondo <[email protected]> * fix prefix and suffix Signed-off-by: Yutaka Kondo <[email protected]> --------- Signed-off-by: Yutaka Kondo <[email protected]> * feat(.github): add `on:push:branches:` condition to `autoware-base` workflow (autowarefoundation#5524) add paths arg Signed-off-by: Yutaka Kondo <[email protected]> * fix(.github): not push manifest if eithor `amd64` or `arm64` image is missing (autowarefoundation#5525) not push manifest if eithor amd64 or arm64 is missing Signed-off-by: Yutaka Kondo <[email protected]> * chore(autoware.repos): fix autoware.core commit hash (autowarefoundation#5530) Signed-off-by: Ryohsuke Mitsudome <[email protected]> * feat(.git): delete `-amd64` and `-arm64` image tags after pushing manifest (autowarefoundation#5526) * not push manifest if eithor amd64 or arm64 is missing Signed-off-by: Yutaka Kondo <[email protected]> * delete -amd64 and -arm64 tags Signed-off-by: Yutaka Kondo <[email protected]> --------- Signed-off-by: Yutaka Kondo <[email protected]> * chore(.github): skip `free-disk-space` action if there are no changed files (autowarefoundation#5536) skip free-disk-space action Signed-off-by: Yutaka Kondo <[email protected]> * ci: enable bugprone-* warnings in clang-tidy (autowarefoundation#5543) Signed-off-by: Ryuta Kambe <[email protected]> * feat(autoware.repos): use version tag for sensor_kits (autowarefoundation#5554) Signed-off-by: Ryohsuke Mitsudome <[email protected]> * ci(pre-commit-ansible): autoupdate (autowarefoundation#5552) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions <[email protected]> * chore(deps): bump peter-evans/create-pull-request from 6 to 7 (autowarefoundation#5162) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](peter-evans/create-pull-request@v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * ci(pre-commit-optional): autoupdate (autowarefoundation#5401) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions <[email protected]> * chore: sync files (autowarefoundation#5541) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions <[email protected]> * chore: sync files (autowarefoundation#5572) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions <[email protected]> * fix(.github): fix CODEOWNERS (autowarefoundation#5575) Update CODEOWNERS * fix: update branch of scenario_simulator_v2 to master (autowarefoundation#5570) Signed-off-by: Fumiya Watanabe <[email protected]> * feat(autoware.repos): remove `autoware_common` from `autoware.repos` (autowarefoundation#5578) * chore(.devcontainer): add `core-devel` development container (autowarefoundation#5574) add core-devel devcontainer Signed-off-by: Yutaka Kondo <[email protected]> --------- Signed-off-by: Yutaka Kondo <[email protected]> Signed-off-by: Ryohsuke Mitsudome <[email protected]> Signed-off-by: Ryuta Kambe <[email protected]> Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Fumiya Watanabe <[email protected]> Co-authored-by: Ryohsuke Mitsudome <[email protected]> Co-authored-by: Ryuta Kambe <[email protected]> Co-authored-by: awf-autoware-bot[bot] <94889083+awf-autoware-bot[bot]@users.noreply.github.com> Co-authored-by: github-actions <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Fumiya Watanabe <[email protected]>
Description
This PR enables
bugprone
prefix warnings in clang-tidy-ci.By specifying
bugprone-*,
first, all thebugprone
prefix warnings are enabled.After that, the warnings which the current Autoware.universe has are disabled by using
-
prefix.The enabled checks are the following.
The current Autoware.universe is free of these warnings.
How was this PR tested?
I locally tested that this configuration works fine and the current Autoware.universe has no errors/warnings with it.
Notes for reviewers
The number of warnings for each check are:
-bugprone-branch-clone, 31
-bugprone-easily-swappable-parameters, too many
-bugprone-exception-escape, 13
-bugprone-implicit-widening-of-multiplication-result, too many
-bugprone-integer-division, 16
-bugprone-macro-parentheses, 1
-bugprone-narrowing-conversions, too many
-bugprone-parent-virtual-call, 1
-bugprone-reserved-identifier, 10
-bugprone-signed-char-misuse" 2
And
bugprone-infinite-loop
is suppressed because it takes too long time to run checkings.Effects on system behavior