Skip to content

Commit

Permalink
Generate: warn for count>100; error and limit for count>1000
Browse files Browse the repository at this point in the history
  • Loading branch information
RagnarGrootKoerkamp committed Nov 16, 2024
1 parent a486075 commit 373db10
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bin/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,15 +1508,25 @@ def parse_count(yaml, warn_for=None):
color_type=MessageType.WARN,
)
return 1
if count > 1000:
if warn_for is not None:
message(
f'Found count: {count}, limited to 1000.',
'generators.yaml',
warn_for,
color_type=MessageType.ERROR,
)
return 1000
if count > 100:
if warn_for is not None:
message(
f'Found count: {count}, limited to 100.',
f'Found large count: {count}.',
'generators.yaml',
warn_for,
color_type=MessageType.WARN,
)
return 100
return count

return count

# Count the number of testcases in the given directory yaml.
Expand Down

0 comments on commit 373db10

Please sign in to comment.