Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5cab8e0

Browse files
authored
Keep dictionary items sorted when updating dart deps. (#730)
Keeping items sorted ensures stable ordering of items during DEPS updates. See 1fde3d4 for example of changing order of items.
1 parent 1f35873 commit 5cab8e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/dart/create_updated_flutter_deps.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ def Main(argv):
124124
else:
125125
updated_value = updated_value + "'"
126126
else:
127-
# Non-string values(dicts) copy verbatim
128-
updated_value = dart_v
127+
# Non-string values(dicts) copy verbatim, keeping them sorted
128+
# to ensure stable ordering of items.
129+
updated_value = dict(sorted(dart_v.items()))
129130

130131
updatedfile.write(" '%s':\n %s,\n\n" % (k, updated_value))
131132
break

0 commit comments

Comments
 (0)