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

CI: Add manual pre-commit hook for clang-tidy #93271

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Jun 17, 2024

Supersedes #90219

Implements a manual hook for clang-tidy, allowing one to utilize clang-tidy without needing separate downloads beyond pre-commit itself. The reason for specifying that it's a "manual" hook is because this type of hook is not automatically invoked; instead, it must be called directly via pre-commit run --hook-stage manual clang-tidy (a comment was added to .pre-commit-config.yaml explaining this). This integration rendered misc/scripts/clang_tidy.sh redundant, so it's been removed.

Additionally, the .clang-tidy file has been given modernized yaml syntax. CheckOptions functions like an implicit dictionary, not needing nearly as many bounding quotes; the only options present are the ones that we've explicitly changed. Checks has been transformed into a multi-line string, making future changes much more obvious for version control. HeaderFileExtensions and ImplementationFileExtensions were added to specify the checked extension types in .pre-commit-config.yaml. FormatStyle was changed to file, so there no longer needs to be a second-pass of clang-format. HeaderFilterRegex was changed to an anti-pattern excluding the thirdparty folder; can be simplified to utilize ExcludeHeaderFilterRegex once v19 is released.

• Set to "manual" so it isn't invoked in normal workflow
• Modernize `.clang-tidy` file
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks great!

@akien-mga akien-mga merged commit a49b7b8 into godotengine:master Jun 18, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants