Skip to content

Commit

Permalink
Ensure that "BIBLIOGRAPHY.bib" file entries are ordered.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed May 1, 2020
1 parent 5d6bfe7 commit f91f191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def formatting(ctx, yapf=True, asciify=True, bibtex=True):
entry[key] = re.sub('(?<!\\\\)\\&', '\\&', value)

with open(bibtex_path, 'w') as bibtex_file:
for entry in bibtex.values():
for entry in sorted(bibtex.values(), key=lambda x: x.key):
bibtex_file.write(entry.to_bib())
bibtex_file.write('\n')

Expand Down

0 comments on commit f91f191

Please sign in to comment.