Skip to content

Commit 0274d77

Browse files
committed
Ensure pre-test is the first item in conditional mark check
1 parent 55947f0 commit 0274d77

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.hooks/pre_commit_hooks/check_conditional_mark_sort.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ def main():
1414
for line in file_contents:
1515
if re.match('^[a-zA-Z]', line):
1616
conditions.append(line.strip().rstrip(":"))
17+
if conditions[0] == 'test_pretest.py':
18+
del conditions[0] # This is at front where it should be
19+
if 'test_pretest.py' in conditions:
20+
print("===========================================================================")
21+
print("test_pretest.py should be the first item in ")
22+
print("tests/common/plugins/conditional_mark/tests_mark_conditions*.yaml")
23+
print("===========================================================================")
24+
return 1
1725
sorted_conditions = conditions[:]
1826
sorted_conditions.sort()
1927
for i in range(len(conditions)):

0 commit comments

Comments
 (0)