-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add clang tidy #5
Conversation
Jenkinsfile
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not using this.
.github/workflows/ros2.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our CI replaces industrial CI
Dockerfile
Outdated
@@ -20,6 +20,7 @@ WORKDIR /colcon_ws | |||
# hadolint ignore=SC1091 | |||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | |||
--mount=type=cache,target=/var/lib/apt,sharing=locked \ | |||
--mount=type=cache,target=/$HOME/.cache,sharing=locked \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think pip in the docker container needs this in CI, was getting errors without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes in this file are just from clang tidy, wanted to have one changed CPP file to make sure it works.
run_clang_tidy.bash
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a convenience script I've used before for developers to run clang tidy locally if they should want.
HeaderFilterRegex: '' | ||
AnalyzeTemporaryDtors: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer a valid option in clang tidy 18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the changes make sense 👍🏽
This adds clang tidy to our CI, but not to pre-commit, though it does add a convenience script for running clang-tidy locally. It'll only run on changed files, but it's still pretty slow.
I changed that one cpp file just to make sure that clang-tidy is working properly. Ideally we could apply all clang tidy changes across the code base at once, but that was a big burden that I didn't want to take on, so I think making it required for any files a PR touches is a good middle ground that will ensure the code quality goes up over time.
The
.clang-tidy
is one I've used in personal and work projects before and has a configuration I like. I think that's sufficient for this repo.