-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Enable clang-tidy for pre-push (opt-out), exclude performance-unnecessary-value-param
#44936
Enable clang-tidy for pre-push (opt-out), exclude performance-unnecessary-value-param
#44936
Conversation
Whomever reviews this, I have no idea how to pass the LICENSES check and could use an adult! |
.clang-tidy-for-githooks
Outdated
@@ -0,0 +1,41 @@ | |||
# Keep in sync with .clang-tidy. |
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-tidy
file is just a yaml file. If clang-tidy
ignores fields it doesn't understand, we could add one in the existing .clang-tidy
file, like IgnoredCheckForFlutterGitHook
(or some better name). Then when running in the context of the pre-push hook, our clang-tidy
wrapper can create a new .clang-tidy
file under /tmp
, and pass that to the clang-tidy
--config-file
flag.
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?
There are instructions at the bottom of the logs for the failing check: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8772102403923285345/+/u/test:_licenses_check/stdout?format=raw. |
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.
lgtm w/ temp dir cleanup.
tools/clang_tidy/lib/clang_tidy.dart
Outdated
@@ -292,6 +299,10 @@ class ClangTidy { | |||
List<Command> commands, | |||
Options options, | |||
) async { | |||
io.File? configPath = options.configPath; | |||
if (configPath != null && options.excludeSlowChecks) { | |||
configPath = _createClangTidyConfigExcludingSlowLints(configPath); |
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.
The temp directory should probably be deleted sometime after _runJobs
finishes up on line 171.
a71ee6d
to
b4bc1e4
Compare
Done! |
auto label is removed for flutter/engine/44936, due to - The status or check suite Linux linux_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
auto label is removed for flutter/engine/44936, due to - The status or check suite Linux linux_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…nce-unnecessary-value-param` (flutter/engine#44936)
…nce-unnecessary-value-param` (flutter/engine#44936)
…nce-unnecessary-value-param` (flutter/engine#44936)
…nce-unnecessary-value-param` (flutter/engine#44936)
…sions) (#133106) Manual roll requested by [email protected] flutter/engine@b190f90...7d56840 2023-08-23 [email protected] Revert "Roll Dart SDK from ab417bc74bb1 to c162b4979562 (1 revision)" (flutter/engine#44989) 2023-08-23 [email protected] Roll Fuchsia Mac SDK from G25oJMO5jbUi-UN4F... to DoQ8KUxSk-5EU6VQ1... (flutter/engine#44988) 2023-08-23 [email protected] Revert "Make `FontWeight` an enum, Remove unused text classes" (flutter/engine#44987) 2023-08-23 [email protected] Roll Dart SDK from ab417bc74bb1 to c162b4979562 (1 revision) (flutter/engine#44986) 2023-08-23 [email protected] Roll Fuchsia Linux SDK from kKI09su99b0AKs8b3... to VSvpNFoFjqXIQTcs6... (flutter/engine#44984) 2023-08-23 [email protected] Enable clang-tidy for pre-push (opt-out), exclude `performance-unnecessary-value-param` (flutter/engine#44936) 2023-08-22 [email protected] Restore old SurfaceTextureExternal drawing code (flutter/engine#44979) 2023-08-22 [email protected] Roll Skia from d0918de21c1a to aa208c8a2d60 (2 revisions) (flutter/engine#44981) 2023-08-22 [email protected] Initialize the texture destruction callback in the Metal embedder test harness (flutter/engine#44973) 2023-08-22 [email protected] Further filter/clear `<SkPaint>.setDither(true)`, this time in `DlSkPaintDispatchHelper` (flutter/engine#44912) 2023-08-22 [email protected] Roll Dart SDK from 3ebf0fedfceb to ab417bc74bb1 (1 revision) (flutter/engine#44977) 2023-08-22 [email protected] Roll Skia from bf6019be75ef to d0918de21c1a (3 revisions) (flutter/engine#44975) 2023-08-22 [email protected] Roll Skia from c675298ddeda to bf6019be75ef (3 revisions) (flutter/engine#44974) 2023-08-22 [email protected] Make `FontWeight` an enum, Remove unused text classes (flutter/engine#44960) 2023-08-22 [email protected] Roll Skia from 9f4b81aac175 to c675298ddeda (2 revisions) (flutter/engine#44971) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from kKI09su99b0A to VSvpNFoFjqXI fuchsia/sdk/core/mac-amd64 from G25oJMO5jbUi to DoQ8KUxSk-5E If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…nce-unnecessary-value-param` (flutter/engine#44936)
Partial (safe) re-land of #44936.
Partial work towards re-landing #44936. Both the `clang_tidy` and `githooks` passage could benefit from being able to automatically find the latest `compile_commands.json` output, which means that some common code should exist in the `tools/` directory. This is a very minimal (but tested) library for doing exactly that.
…ssary-value-param` (flutter#44936) Closes flutter/flutter#132687. Zach, this is a pretty naive attempt, so feel free to suggest alternatives. I considered for example just using `--checks=-{{LINT}}` as well, but figured that might be less discoverable (especially for non-core folks) than just a file called `.clang-tidy-for-githooks`. /cc @jonahwilliams
…e-unnecessary-value-param`" (flutter#45020) Reverts flutter#44936
Partial (safe) re-land of flutter#44936.
…ter#45154) Partial work towards re-landing flutter#44936. Both the `clang_tidy` and `githooks` passage could benefit from being able to automatically find the latest `compile_commands.json` output, which means that some common code should exist in the `tools/` directory. This is a very minimal (but tested) library for doing exactly that.
Closes flutter/flutter#132687.
Zach, this is a pretty naive attempt, so feel free to suggest alternatives. I considered for example just using
--checks=-{{LINT}}
as well, but figured that might be less discoverable (especially for non-core folks) than just a file called.clang-tidy-for-githooks
./cc @jonahwilliams