From patchwork Sun Aug 4 12:06:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20756 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 AF912C323E for ; Sun, 4 Aug 2024 12:07:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CBBC76192D; Sun, 4 Aug 2024 14:07:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bOPu6SvW"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 85EA26192D for ; Sun, 4 Aug 2024 14:07:18 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B323F1BA for ; Sun, 4 Aug 2024 14:06:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1722773187; bh=f60ZcWrHGu7hkN+STo9UQOceVXeJKDtF2u4whwVtWlc=; h=From:To:Subject:Date:From; b=bOPu6SvWFouGQtqG6DzCtZcDgHVUruDnarwdtM0ek6nXshBEP4NxPinVo6oZJHMCW sLJatcN+eKVfqz4TqqfinwzTHzLhHKUjgEHJH2dzsKw7Iqynm3aMtKwNLW+0YS8jLX Ho9lGOWh7anVZ6uI55HE0M7P+xGey5ZzpF6adYKg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH] utils: checkstyle.py: Warn when no valid Signed-off-by line is found Date: Sun, 4 Aug 2024 15:06:56 +0300 Message-ID: <20240804120656.29935-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" All commits to libcamera must include a Signed-off-by line, and that rule is enforced through git hooks and CI. This however doesn't prevent patches from being submitted without an SoB tag, as noticed multiple times in the past. Extend the checkstyle.py trailer checker to issue a warning when the SoB line is missing to try and improve the situation. Signed-off-by: Laurent Pinchart Reviewed-by: Milan Zamazal Reviewed-by: Kieran Bingham --- utils/checkstyle.py | 8 ++++++++ 1 file changed, 8 insertions(+) base-commit: 19bbca3c0b376ba0183f5db53472c8c46cd402b5 diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 4185c39ac811..7d480bdf4a2f 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -493,6 +493,8 @@ class TrailersChecker(CommitChecker): def check(cls, commit, top_level): issues = [] + sob_found = False + for trailer in commit.trailers: match = TrailersChecker.trailer_regex.fullmatch(trailer) if not match: @@ -515,6 +517,12 @@ class TrailersChecker(CommitChecker): issues.append(CommitIssue(f"Malformed value '{value}' for commit trailer '{key}'")) continue + if key == 'Signed-off-by': + sob_found = True + + if not sob_found: + issues.append(CommitIssue(f"No valid 'Signed-off-by' trailer found, see Documentation/contributing.rst")) + return issues