From 1ee4890a12da113d4a8c0e01fed11843c9cbf8d7 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Fri, 8 Dec 2023 12:28:38 -0800 Subject: [PATCH 1/6] Move yapf. --- DEPS | 2 +- ci/licenses_golden/excluded_files | 2 +- tools/licenses/lib/paths.dart | 2 +- tools/yapf.sh | 12 +++++++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index f703bfe9e69a7..ed497c2b68ea2 100644 --- a/DEPS +++ b/DEPS @@ -315,7 +315,7 @@ deps = { 'src/third_party/boringssl': Var('dart_git') + '/boringssl_gen.git' + '@' + Var('dart_boringssl_gen_rev'), - 'src/third_party/yapf': + 'src/flutter/third_party/yapf': Var('github_git') + '/google/yapf' + '@' + '212c5b5ad8e172d2d914ae454c121c89cccbcb35', 'src/third_party/boringssl/src': diff --git a/ci/licenses_golden/excluded_files b/ci/licenses_golden/excluded_files index 1a3d32805dbf8..43afd2017f987 100644 --- a/ci/licenses_golden/excluded_files +++ b/ci/licenses_golden/excluded_files @@ -1071,6 +1071,7 @@ ../../../flutter/third_party/wuffs/release/c/README.md ../../../flutter/third_party/wuffs/script ../../../flutter/third_party/wuffs/sync.txt +../../../flutter/third_party/yapf ../../../flutter/tools ../../../flutter/tools/licenses/.dart_tool ../../../flutter/tools/licenses/.gitignore @@ -3212,7 +3213,6 @@ ../../../third_party/vulkan_memory_allocator/src ../../../third_party/vulkan_memory_allocator/tools ../../../third_party/web_dependencies/canvaskit -../../../third_party/yapf ../../../third_party/zlib/.git ../../../third_party/zlib/CMakeLists.txt ../../../third_party/zlib/DIR_METADATA diff --git a/tools/licenses/lib/paths.dart b/tools/licenses/lib/paths.dart index a8d44eecacd09..1fd99a2a35a91 100644 --- a/tools/licenses/lib/paths.dart +++ b/tools/licenses/lib/paths.dart @@ -94,6 +94,7 @@ final Set skippedPaths = { r'flutter/third_party/txt/third_party/fonts', r'flutter/third_party/wuffs/docs', r'flutter/third_party/wuffs/script', + r'flutter/third_party/yapf', // only used for code formatting r'flutter/tools', r'flutter/web_sdk', // this code is not linked into Flutter apps; it's only used by engine tests and tools r'fuchsia/sdk/linux/docs', @@ -214,7 +215,6 @@ final Set skippedPaths = { r'third_party/vulkan_memory_allocator/src', r'third_party/vulkan_memory_allocator/tools', r'third_party/web_dependencies/canvaskit', // redundant; covered by Skia dependencies - r'third_party/yapf', // only used for code formatting r'third_party/zlib/contrib/minizip/miniunz.c', // sample file r'third_party/zlib/contrib/minizip/minizip.c', // sample file r'tools', // not distributed in binary diff --git a/tools/yapf.sh b/tools/yapf.sh index c3cbd5587e47d..e309eda3db88b 100755 --- a/tools/yapf.sh +++ b/tools/yapf.sh @@ -24,7 +24,7 @@ set -e function follow_links() ( cd -P "$(dirname -- "$1")" file="$PWD/$(basename -- "$1")" - while [[ -h "$file" ]]; do + while [[ -L "$file" ]]; do cd -P "$(dirname -- "$file")" file="$(readlink -- "$file")" cd -P "$(dirname -- "$file")" @@ -34,7 +34,13 @@ function follow_links() ( ) SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")") -SRC_DIR="$(cd "$SCRIPT_DIR/../.."; pwd -P)" -YAPF_DIR="$(cd "$SRC_DIR/third_party/yapf"; pwd -P)" +SRC_DIR="$( + cd "$SCRIPT_DIR/../.." + pwd -P +)" +YAPF_DIR="$( + cd "$SRC_DIR/flutter/third_party/yapf" + pwd -P +)" PYTHONPATH="$YAPF_DIR" python3 "$YAPF_DIR/yapf" "$@" From ef0debe8a3bf4f5f8fc00830e3441512d11d2039 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Fri, 8 Dec 2023 14:19:20 -0800 Subject: [PATCH 2/6] Update tool signature. --- ci/licenses_golden/tool_signature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/licenses_golden/tool_signature b/ci/licenses_golden/tool_signature index afcf54ffee400..38b2728a4a3b6 100644 --- a/ci/licenses_golden/tool_signature +++ b/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: 90d7ddb0684f0d9d245924c2db26e02a +Signature: 761d7cd498ba5573a7348d86204276be From a0fad5ee38af6ff528755c7a4d422caf3cd7e702 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Fri, 8 Dec 2023 15:05:05 -0800 Subject: [PATCH 3/6] ++ --- tools/yapf.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/yapf.sh b/tools/yapf.sh index e309eda3db88b..c3cbd5587e47d 100755 --- a/tools/yapf.sh +++ b/tools/yapf.sh @@ -24,7 +24,7 @@ set -e function follow_links() ( cd -P "$(dirname -- "$1")" file="$PWD/$(basename -- "$1")" - while [[ -L "$file" ]]; do + while [[ -h "$file" ]]; do cd -P "$(dirname -- "$file")" file="$(readlink -- "$file")" cd -P "$(dirname -- "$file")" @@ -34,13 +34,7 @@ function follow_links() ( ) SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")") -SRC_DIR="$( - cd "$SCRIPT_DIR/../.." - pwd -P -)" -YAPF_DIR="$( - cd "$SRC_DIR/flutter/third_party/yapf" - pwd -P -)" +SRC_DIR="$(cd "$SCRIPT_DIR/../.."; pwd -P)" +YAPF_DIR="$(cd "$SRC_DIR/third_party/yapf"; pwd -P)" PYTHONPATH="$YAPF_DIR" python3 "$YAPF_DIR/yapf" "$@" From 32e3da33df6085c29dd2a17dd823be17897bd5fe Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 11 Dec 2023 13:55:16 -0800 Subject: [PATCH 4/6] Update paths and signature. --- ci/licenses_golden/tool_signature | 7 +------ tools/yapf.bat | 2 +- tools/yapf.sh | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/ci/licenses_golden/tool_signature b/ci/licenses_golden/tool_signature index 08d286ab6cd9a..5bbd15eb0e474 100644 --- a/ci/licenses_golden/tool_signature +++ b/ci/licenses_golden/tool_signature @@ -1,6 +1 @@ -<<<<<<< HEAD -Signature: 761d7cd498ba5573a7348d86204276be -======= -Signature: 8063c36f273a2ca0d4db5f05f9d5991a ->>>>>>> upstream/main - +9c9e9d44a47e4d85f1debd69bc795b40 diff --git a/tools/yapf.bat b/tools/yapf.bat index 587989cedb92a..e75ae51364a32 100644 --- a/tools/yapf.bat +++ b/tools/yapf.bat @@ -11,6 +11,6 @@ REM work across all platforms! REM REM -------------------------------------------------------------------------- -SET yapf_path=%~dp0\..\..\third_party\yapf +SET yapf_path=%~dp0\..\..\flutter\third_party\yapf cmd /V /C "SET PYTHONPATH=%yapf_path%&& vpython3 %yapf_path%\yapf %*" diff --git a/tools/yapf.sh b/tools/yapf.sh index c3cbd5587e47d..48d0974a0102a 100755 --- a/tools/yapf.sh +++ b/tools/yapf.sh @@ -35,6 +35,6 @@ function follow_links() ( SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")") SRC_DIR="$(cd "$SCRIPT_DIR/../.."; pwd -P)" -YAPF_DIR="$(cd "$SRC_DIR/third_party/yapf"; pwd -P)" +YAPF_DIR="$(cd "$SRC_DIR/flutter/third_party/yapf"; pwd -P)" PYTHONPATH="$YAPF_DIR" python3 "$YAPF_DIR/yapf" "$@" From 6a1f6ca376fd5662c6607f9f8be398cd0f2cf968 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 11 Dec 2023 14:26:19 -0800 Subject: [PATCH 5/6] ++ --- ci/licenses_golden/tool_signature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/licenses_golden/tool_signature b/ci/licenses_golden/tool_signature index 5bbd15eb0e474..66bca618188dd 100644 --- a/ci/licenses_golden/tool_signature +++ b/ci/licenses_golden/tool_signature @@ -1 +1 @@ -9c9e9d44a47e4d85f1debd69bc795b40 +Signature: 9c9e9d44a47e4d85f1debd69bc795b40 From e894eeb1c2879fe6d2ac3964038a9deac3de447a Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 11 Dec 2023 14:40:16 -0800 Subject: [PATCH 6/6] ++ --- ci/licenses_golden/tool_signature | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/licenses_golden/tool_signature b/ci/licenses_golden/tool_signature index 66bca618188dd..5970ad247311b 100644 --- a/ci/licenses_golden/tool_signature +++ b/ci/licenses_golden/tool_signature @@ -1 +1,2 @@ Signature: 9c9e9d44a47e4d85f1debd69bc795b40 +