Skip to content

engine's format script fails to apply fix to format #183464

@hellohuanlin

Description

@hellohuanlin

Steps to reproduce

  1. Try it on this commit: ee1e22b
  2. CD to engine directory: e.g./Users/huanlin/Desktop/flutter/flutter/engine/src/flutter
  3. Run ./ci/format.sh --fix
  4. Observe the error:
Fixing any Dart format problems
Fixing Dart formatting...
All dart files formatted correctly.                                                                         
Fixing any GN format problems
Fixing GN formatting...
Fixed 1 GN file which was formatted incorrectly.                                                          
Fixing any Java format problems
Fixing Java formatting...
Checking Java formatting...
No Java files with changes, skipping Java format check.
Fixing any Python format problems
Fixing Python formatting...
All python files formatted correctly.                                                                         
Fixing any Trailing whitespace format problems
Checking for trailing whitespace on 33 source files...
No trailing whitespace found.                                                                              
Fixing any Header guards format problems
Fixing any C++/ObjC/Shader format problems
Fixing C++/ObjC/Shader formatting...
Checking C++/ObjC/Shader formatting...
Fixing 1 C++/ObjC/Shader file which was formatted incorrectly.                                               
ERROR: 1 patch failed to apply.completed,  0 in progress,   0 pending,   1 failed.                    
error: patch failed: engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h:256
error: engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h: patch does not apply

Workaround:

  1. run ./ci/format.sh instead (without --fix)
  2. This patch will get print out. Copy it and then replace git apply <<DONE with git apply <<'DONE' (add quote). It should work after adding quote.
git apply <<DONE
diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
index 5916d9f5910..00000000000 100644
--- a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
+++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
@@ -256,13 +256,14 @@ typedef enum {
    * Flutter blocks all the UIGestureRecognizers on the platform view as soon as it
    * decides they should be blocked.
    *
-   * This policy employs a dual blocking strategy: synchronous blocking via hitTest results and asynchronous blocking managed through the framework’s gesture arena.
-   * With this policy, only the `touchesBegan` method for all the UIGestureRecognizers is guaranteed
-   * to be called.
+   * This policy employs a dual blocking strategy: synchronous blocking via hitTest results and
+   * asynchronous blocking managed through the framework’s gesture arena. With this policy, only the
+   * `touchesBegan` method for all the UIGestureRecognizers is guaranteed to be called.
    */
   FlutterPlatformViewGestureRecognizersBlockingPolicyEager,
   /**
-   * Flutter blocks all the UIGestureRecognizers on the platform view only after touchesEnded was invoked.
+   * Flutter blocks all the UIGestureRecognizers on the platform view only after touchesEnded was
+   * invoked.
    *
    * This results in the platform view's UIGestureRecognizers seeing the entire touch sequence,
    * but never recognizing the gesture (and never invoking actions).
@@ -271,8 +272,10 @@ typedef enum {
   /**
    * Flutter blocks all the UIGestureRecognizers on the platform view based on results from hitTest.
    *
-   * Unlike FlutterPlatformViewGestureRecognizersBlockingPolicyEager, this policy does not rely on Flutter's gesture arena. This is a workaround to address a few bugs related to platform view's gesture recognizers being stuck in a stale state.
-   * See: https://github.com/flutter/flutter/issues/175099.
+   * Unlike FlutterPlatformViewGestureRecognizersBlockingPolicyEager, this policy does not rely on
+   * Flutter's gesture arena. This is a workaround to address a few bugs related to platform view's
+   * gesture recognizers being stuck in a stale state. See:
+   * https://github.com/flutter/flutter/issues/175099.
    */
   FlutterPlatformViewGestureRecognizersBlockingPolicyDoNotBlockGesture,
   // NOLINTEND(readability-identifier-naming)
DONE

Expected results

Should not fail to format

Actual results

Fail to format

Code sample

NA

Screenshots or Video

NA

Logs

NA

Flutter Doctor output

NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine teamworkaround availableThere is a workaround available to overcome the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions