Skip to content

Commit

Permalink
Improve refresh code excerpts when checking codes (#9194)
Browse files Browse the repository at this point in the history
Detecting code excerpts during checking codes would not tell what codes
are refreshed during the check. This PR adds `git diff` result to tell
the difference.

This was inspired during our sync work and implemented in
cfug/flutter.cn#1341.

---------

Co-authored-by: Anthony Sansone <[email protected]>
Co-authored-by: Parker Lougheed <[email protected]>
Co-authored-by: Brett Morgan <[email protected]>
  • Loading branch information
4 people authored Oct 26, 2023
1 parent b9bcdac commit e11bcec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tool/check-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ flutter --version
if [[ $REFRESH ]]; then
echo "=> Refreshing code excerpts..."
(
commitHash=$(git reflog -n1 --format='%h')
git add .
git commit -m "Temporarily commit code excerpt changes"
set -x
tool/refresh-code-excerpts.sh --keep-dart-tool
git reset --soft $commitHash
) || (
git --no-pager diff
echo "=> ERROR: some code excerpts were not refreshed!"
exit 1
)
Expand Down

0 comments on commit e11bcec

Please sign in to comment.