From 373db102989fa3a6d9b5c19a1faa996cd7a808e6 Mon Sep 17 00:00:00 2001 From: Ragnar Groot Koerkamp Date: Sat, 16 Nov 2024 16:12:10 +0100 Subject: [PATCH] Generate: warn for count>100; error and limit for count>1000 --- bin/generate.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/generate.py b/bin/generate.py index f3977ae9..f57551ad 100644 --- a/bin/generate.py +++ b/bin/generate.py @@ -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.