From patchwork Tue Jul 11 13:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 18806 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AAEA5C3243 for ; Tue, 11 Jul 2023 13:39:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E5D82628C7; Tue, 11 Jul 2023 15:39:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1689082762; bh=NcyCkiLhkOsMM7/Czz7Q19u8pchZ6gml5HMwcIfkcxw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=vNF8Bms0M2HMig1z9imQv/h2V9Ujdq5kcEWfsK2AQyJqHS2I5LXXomacCKDLx/r+U 2Ewx/m7DnzzNFHka64nqVhEW6BaS16BDy2Bp+hA5t2KFsPnStcFF5mMKob9x9jjBfO lSaUcCWPLbeMj2nWFcoGHQJmuFMUgLyy067nimiI0dfIYWiALK4RGstRsbDzVRgTQZ PstHKkFa6jse3iPDe0BGdgvIg8mrs4YZ63lKJpYqoH+6cu/YduFe2R81OkzsRPvLKt 5OjTm//2GloPkb9hsi9qRBn5L4RG3cx/ZDgUI3eSxt5+XOM7g38E61R753ul+/gESJ v3ClNPjt/uAwA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6AEF861E32 for ; Tue, 11 Jul 2023 15:39:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="R/eVzJi/"; dkim-atps=neutral Received: from Monstersaurus.local (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 69EFF9B9; Tue, 11 Jul 2023 15:38:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689082711; bh=NcyCkiLhkOsMM7/Czz7Q19u8pchZ6gml5HMwcIfkcxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R/eVzJi/QzQ6urHl2NFDeisj6P2rQlViluwuZdhB/Shlkwn7DMOQAybDpXezP79NG +ry7JXf18pfOTQU2xCnIlU4Zxz7GGPktVIp1ywDsA7i+7NJNWdFgeIREckcZMKw8Sb 5NqQC006XAWCIaWs+pqBZEzlUGw1X25SDUhXj56k= To: libcamera devel Date: Tue, 11 Jul 2023 14:39:12 +0100 Message-Id: <20230711133915.650485-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230711133915.650485-1-kieran.bingham@ideasonboard.com> References: <20230711133915.650485-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/4] utils: checkstyle.py: Treat Malformed trailers as a CommitIssue X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If a Malformed trailer is identified the checkstyle script triggers a RuntimeError and stops processing the rest of the commit. A malformed trailer can be regarded as an issue in the commit and reported as such using the same method as other faults identified by the tool. Convert the RuntimeError into a CommitIssue and continue processing other trailers. Signed-off-by: Kieran Bingham Reviewed-by: Umang Jain --- utils/checkstyle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 3558740d389d..5a1268064d31 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -479,7 +479,8 @@ class TrailersChecker(CommitChecker): for trailer in commit.trailers: match = TrailersChecker.trailer_regex.fullmatch(trailer) if not match: - raise RuntimeError(f"Malformed commit trailer '{trailer}'") + issues.append(CommitIssue(f"Malformed commit trailer '{trailer}'")) + continue key, value = match.groups()