Skip to content

Commit f4d674c

Browse files
committed
Fix misleading error when missing problem statemetns
1 parent e0410d3 commit f4d674c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

problemtools/verifyproblem.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,13 @@ def check(self, context: Context) -> bool:
754754
self._check_res = True
755755

756756
if not self.statements:
757-
allowed_statements = ', '.join(
758-
f'problem.{ext}, problem.[a-z][a-z].{ext}' for ext in self.problem.format.statement_extensions
759-
)
757+
if self.problem.format is FormatVersion.LEGACY:
758+
allowed_statements = ', '.join(
759+
f'problem.{ext}, problem.<language>.{ext}' for ext in self.problem.format.statement_extensions
760+
)
761+
else:
762+
allowed_statements = ', '.join(f'problem.<language>.{ext}' for ext in self.problem.format.statement_extensions)
763+
760764
self.error(
761765
f'No problem statements found (expected file of one of following forms in directory {self.problem.format.statement_directory}/: {allowed_statements})'
762766
)

0 commit comments

Comments
 (0)