From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9630C12002 for ; Wed, 21 Jul 2021 14:19:47 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2C7B60C3D for ; Wed, 21 Jul 2021 14:19:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2C7B60C3D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1854382991; Wed, 21 Jul 2021 16:19:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="aEezGQtT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0CF0829C7; Wed, 21 Jul 2021 16:19:41 +0200 (CEST) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C799482977 for ; Wed, 21 Jul 2021 16:19:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-wr1-x431.google.com with SMTP id f17so2388148wrt.6 for ; Wed, 21 Jul 2021 07:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=cB1Z8iTuGbGbGHaU3Yp5354EcUUnCTpO0DE7z1gbuTs=; b=aEezGQtTe5iIBjegyaJvdO8Ly/X4tHaPaLhuNVbZI7ryHCFUSl7mdjizpU8Oy31RcN lFU46FlZGuq0rO/nwHe+aVelt4S40R+UOfUOySFV4w/vvbGUt5OGwDINVsITuXZAyN4S AixAoObkkWq8zC9r6jUyIxNnycmL73B1/eeKs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=cB1Z8iTuGbGbGHaU3Yp5354EcUUnCTpO0DE7z1gbuTs=; b=nZgz5J/CQo6mW1D7wHuUXRn0172thtrwGj8aXyCs2kdc+BmxOyLufcADYjk7xhHioL dLMUgF10h+8z8cRq/GwKPdCPBKlDbWLQTfc6NYj490a+GYJgAiM5ZVnZgNffMktsoNar dbN5EUgygARlGRK9XPGbbGdGnYHC5lpXKL6oVrSQA3UXKSFhh2FEt7Xc1gYKl6mQi4N1 vcotbRGjiwoiTAzdAPP1vVPdOg01UO3ti2ZOvQW3umDWZDi1NBu/YegHI0z0f+8NFa82 3V0gOxJTZJ3rVk17JlA9ycZyrSdjxlL26K/UcxalDiL0IgUZZOpVZ9qmxS8xQT0A0Lu8 huTg== X-Gm-Message-State: AOAM531hLYKDgpuNzk/JBq/gZv3IT4q76eB7KkYgyJGTqhzfaxS78AeP xEi9GcqcS/Ii3Puh0b6abizsjhwtMU3yN1mpjM+kmkBN5HRdoA== X-Google-Smtp-Source: ABdhPJy1fauZGhR7XIANxClSSrnsv1IE32+ruq2WkjQ8hq3Cz78i9hSFT2rko9dbJLGS4YxtpajEL9y5hNrKT/aOy7I= X-Received: by 2002:adf:ce83:: with SMTP id r3mr43506049wrn.204.1626877178030; Wed, 21 Jul 2021 07:19:38 -0700 (PDT) MIME-Version: 1.0 References: <20210721114521.1.I6630d4cc18870d3e830587ffbcb61898dc045cb6@changeid> In-Reply-To: <20210721114521.1.I6630d4cc18870d3e830587ffbcb61898dc045cb6@changeid> From: Simon Glass Date: Wed, 21 Jul 2021 08:19:26 -0600 Message-ID: Subject: Re: [PATCH] patman: add warning for invalid tag To: Patrick Delaunay Cc: U-Boot Mailing List , U-Boot STM32 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Patrick, On Wed, 21 Jul 2021 at 03:45, Patrick Delaunay wrote: > > Add a error in patman tool when the commit message contents an invalid > tag "Serie-.*" instead of "Series-.*". > > Signed-off-by: Patrick Delaunay > --- > I create this patch to avoid my frequent mistake: > using "Serie-" tag instead of "Series-" as it is done in [1]. > > RE_INV_TAG can be extended to other frequent errors. > > Any "Serie-" tag is refused with the patch, for example: > > ValueError: Line 28: Invalid tag =3D > 'Serie-cc: Marek Beh=C3=BAn ' > > [1] http://patchwork.ozlabs.org/project/uboot/patch/20210720203353.1.I550= b95f6d12d59aeef5b744d837dbb360037d39e@changeid/ > > > tools/patman/patchstream.py | 9 +++++++++ > 1 file changed, 9 insertions(+) This is a great idea! But please do add a test. > > diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py > index a44cd861af..b960292427 100644 > --- a/tools/patman/patchstream.py > +++ b/tools/patman/patchstream.py > @@ -59,6 +59,9 @@ RE_DIFF =3D re.compile(r'^>.*diff --git a/(.*) b/(.*)$'= ) > # Detect a context line, like '> @@ -153,8 +153,13 @@ CheckPatch > RE_LINE =3D re.compile(r'>.*@@ \-(\d+),\d+ \+(\d+),\d+ @@ *(.*)') > > +# Detect line with invalid TAG > +RE_INV_TAG =3D re.compile('^Serie-([a-z-]*): *(.*)') > + > # States we can be in - can we use range() and still have comments? > STATE_MSG_HEADER =3D 0 # Still in the message header > STATE_PATCH_SUBJECT =3D 1 # In patch subject (first line of log for = a commit) > @@ -318,6 +321,7 @@ class PatchStream: > leading_whitespace_match =3D RE_LEADING_WHITESPACE.match(line) > diff_match =3D RE_DIFF.match(line) > line_match =3D RE_LINE.match(line) > + invalid_match =3D RE_INV_TAG.match(line) > tag_match =3D None > if self.state =3D=3D STATE_PATCH_HEADER: > tag_match =3D RE_TAG.match(line) > @@ -471,6 +475,11 @@ class PatchStream: > self._add_warn('Line %d: Ignoring Commit-%s' % > (self.linenum, name)) > > + # Detect invalid tags > + elif invalid_match: > + raise ValueError("Line %d: Invalid tag =3D '%s'" % > + (self.linenum, line)) > + > # Detect the start of a new commit > elif commit_match: > self._close_commit() > -- > 2.25.1 > Regards, Simon