Skip to content

Commit fa6d00d

Browse files
author
Joseph Damiba
committed
fixing up ci script to catch duplicate orders
1 parent a21e8d5 commit fa6d00d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

check-order.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@
3030
print(order)
3131

3232
if order[0] != 1:
33-
raise Exception("Order Check Failed! First post does not have order 1!")
33+
raise Exception("Order Check Failed! First post in {} display_as does not have order 1!".format(category))
3434

3535
def checkConsecutive(l):
3636
return sorted(l) == list(range(min(l), max(l)+1))
3737

3838
try:
3939
checkConsecutive(order)
4040
except:
41-
raise Exception("Order Check Failed! Orders are not consecutive integers!!")
41+
raise Exception("Order Check Failed! Orders in {} display_as are not consecutive integers!!".format(category))
4242

43-
print("Order Checks Passed!")
43+
if len(order) != len(set(order)):
44+
raise Exception("Order Check Failed! {} display_as has duplicate order frontmatter!!".format(category))
45+
46+
47+
print("Order Checks Passed for {} display_as!".format(category))
4448
order = []

python/ternary-contour.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jupyter:
2727
language: python
2828
layout: base
2929
name: Ternary contours
30-
order: 18
30+
order: 19
3131
page_type: u-guide
3232
permalink: python/ternary-contour/
3333
thumbnail: thumbnail/ternary-contour.jpg

0 commit comments

Comments
 (0)