This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Enable clang-tidy for pre-push (opt-out), exclude performance-unnecessary-value-param
#44936
Merged
auto-submit
merged 15 commits into
flutter-team-archive:main
from
matanlurey:engine-clang-tidy-for-githooks
Aug 23, 2023
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d0dfeaa
Augment the clang-tidy pre-push to use a different config.
matanlurey f38c264
Fix and add test.
matanlurey 7c7d385
Whitespace.
matanlurey a278a9c
Ignore licenses.
matanlurey dce3ced
Also update this I suppose.
matanlurey ad5fac4
Merge branch 'main' into engine-clang-tidy-for-githooks
matanlurey 46d184e
Use some suggestions from Zach on clang_tidy resolution.
matanlurey 2ffa7b3
Address comments, accumulate different kinds of tech debt.
matanlurey 30c4ee8
Format.
matanlurey 5c3c5af
Remove whitespace.
matanlurey 70e2a25
Fix resolution.
matanlurey 2becd72
Delete temp directory.
matanlurey b4bc1e4
Merge remote-tracking branch 'upstream/main' into engine-clang-tidy-f…
matanlurey d7a9f1c
Merge branch 'main' into engine-clang-tidy-for-githooks
matanlurey bd3e24c
Fix test.
matanlurey 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
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,41 @@ | ||
| # Keep in sync with .clang-tidy. | ||
| # | ||
| # These checks are run by the git hooks presubmit script, but are not run by the | ||
| # CI presubmit script. The CI presubmit script runs a superset of these checks | ||
| # (it's OK if CI takes 10s of minutes, but not git push). | ||
| Checks: "bugprone-use-after-move,\ | ||
| bugprone-unchecked-optional-access,\ | ||
| clang-analyzer-*,\ | ||
| clang-diagnostic-*,\ | ||
| darwin-*,\ | ||
| google-*,\ | ||
| modernize-use-default-member-init,\ | ||
| objc-*,\ | ||
| -objc-nsinvocation-argument-lifetime,\ | ||
| readability-identifier-naming,\ | ||
| -google-build-using-namespace,\ | ||
| -google-default-arguments,\ | ||
| -google-objc-global-variable-declaration,\ | ||
| -google-objc-avoid-throwing-exception,\ | ||
| -google-readability-casting,\ | ||
| -clang-analyzer-nullability.NullPassedToNonnull,\ | ||
| -clang-analyzer-nullability.NullablePassedToNonnull,\ | ||
| -clang-analyzer-nullability.NullReturnedFromNonnull,\ | ||
| -clang-analyzer-nullability.NullableReturnedFromNonnull,\ | ||
| performance-move-const-arg" | ||
|
|
||
| CheckOptions: | ||
| - key: modernize-use-default-member-init.UseAssignment | ||
| value: true | ||
| - key: readability-identifier-naming.EnumConstantCase | ||
| value: 'CamelCase' | ||
| - key: readability-identifier-naming.EnumConstantPrefix | ||
| value: 'k' | ||
| - key: readability-identifier-naming.GlobalConstantCase | ||
| value: 'CamelCase' | ||
| - key: readability-identifier-naming.GlobalConstantPrefix | ||
| value: 'k' | ||
| - key: readability-identifier-naming.PrivateMemberCase | ||
| value: 'lower_case' | ||
| - key: readability-identifier-naming.PrivateMemberSuffix | ||
| value: '_' | ||
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
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.
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 should try to think of some ideas to avoid the duplication. Here's one:
The
.clang-tidyfile is just a yaml file. Ifclang-tidyignores fields it doesn't understand, we could add one in the existing.clang-tidyfile, likeIgnoredCheckForFlutterGitHook(or some better name). Then when running in the context of the pre-push hook, ourclang-tidywrapper can create a new.clang-tidyfile under/tmp, and pass that to theclang-tidy--config-fileflag.Uh oh!
There was an error while loading. Please reload this page.
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.
Done, though I couldn't quite handle the way we both wanted as I'll need to bring in the YAML package.
OK with doing that, but it should probably be a follow-up PR. Wdyt of my hack?