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

Add clang tidy #5

Merged
merged 23 commits into from
Oct 4, 2024
Merged

Add clang tidy #5

merged 23 commits into from
Oct 4, 2024

Conversation

henrygerardmoore
Copy link
Collaborator

@henrygerardmoore henrygerardmoore commented Oct 3, 2024

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.

Jenkinsfile Outdated
Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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 \
Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

Copy link
Collaborator

@bgill92 bgill92 left a 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 👍🏽

@henrygerardmoore henrygerardmoore enabled auto-merge (squash) October 4, 2024 18:12
@henrygerardmoore henrygerardmoore merged commit f587c2c into main Oct 4, 2024
4 checks passed
@henrygerardmoore henrygerardmoore deleted the add_clang_tidy branch October 4, 2024 18:29
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