Added output limitation
@@ -15,6 +15,7 @@ init(autoreset=True)
DEFAULT_SEVERITY = "none" # equivalent to a score of 0.0 in the CVSS v3.0 Ratings
+output_violation_len = os.environ.get('CHECKOV_OUTPUT_VIOLATION_LENGTH', 50)
class Record:
check_id = ""
@@ -118,6 +119,9 @@ class Record:
color_codes = (Fore.WHITE if colorized else "", Fore.YELLOW if colorized else "")
last_line_number_len = len(str(code_block[-1][0]))
+ if len(code_block) >= output_violation_len:
+ return f'\t\t{color_codes[1]}Text is too long.'
+
for line_num, line in code_block:
spaces = " " * (last_line_number_len - len(str(line_num)))
if line.lstrip().startswith("#"):
