Skip to content

Commit 770419e

Browse files
committed
Ensure that "BIBLIOGRAPHY.bib" file entries are ordered.
1 parent 0ce06df commit 770419e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def formatting(ctx, yapf=True, asciify=True, bibtex=True):
127127
entry[key] = re.sub('(?<!\\\\)\\&', '\\&', value)
128128

129129
with open(bibtex_path, 'w') as bibtex_file:
130-
for entry in bibtex.values():
130+
for entry in sorted(bibtex.values(), key=lambda x: x.key):
131131
bibtex_file.write(entry.to_bib())
132132
bibtex_file.write('\n')
133133

0 commit comments

Comments
 (0)