From 420ffdd8a88ac0d06f6a7b677b4a2b8714f4374f Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 20 Aug 2024 08:59:55 -0400 Subject: [PATCH] ci: compliance: in case of too many errors, send as a single failure Do not try to format each single failure, this will take too long to process and will run for hours and spam GH. Signed-off-by: Anas Nashif --- scripts/ci/check_compliance.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 95f4290f25c..ab124e68f2d 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -221,6 +221,13 @@ class CheckPatch(ComplianceTest): r'^\s*#(\d+):\s*FILE:\s*(.+):(\d+):' matches = re.findall(regex, output, re.MULTILINE) + + # add a guard here for excessive number of errors, do not try and + # process each one of them and instead push this as one failure. + if len(matches) > 500: + self.failure(output) + return + for m in matches: self.fmtd_failure(m[1].lower(), m[2], m[5], m[6], col=None, desc=m[3])