Skip to content

Commit b7fd1b9

Browse files
committed
Iterate over files and directories in a stable order.
This avoids spurious diffs caused by generating e.g. the Maktaba flags in an unpredictable order. Fixes #75.
1 parent 24790de commit b7fd1b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vimdoc/module.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ def Modules(directory):
324324
standalone_paths = []
325325
autoloaddir = os.path.join(directory, 'autoload')
326326
for (root, dirs, files) in os.walk(directory):
327+
# Visit files in a stable order, since the ordering of e.g. the Maktaba
328+
# flags below depends upon the order that we visit the files.
329+
dirs.sort()
330+
files.sort()
331+
327332
# Prune non-standard top-level dirs like 'test'.
328333
if root == directory:
329334
dirs[:] = [x for x in dirs if x in DOC_SUBDIRS + ['after']]

0 commit comments

Comments
 (0)