From patchwork Mon Oct 26 01:04:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CKGwP1XcHz9sT6 for ; Mon, 26 Oct 2020 12:10:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ECmWksqL; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CKGwN6gYrzDqCl for ; Mon, 26 Oct 2020 12:10:12 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::12d; helo=mail-il1-x12d.google.com; envelope-from=sjg@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ECmWksqL; dkim-atps=neutral Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CKGpb2gpdzDqDD for ; Mon, 26 Oct 2020 12:05:11 +1100 (AEDT) Received: by mail-il1-x12d.google.com with SMTP id j8so6778422ilk.0 for ; Sun, 25 Oct 2020 18:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CahQFBcWvhtigFEizm0+Q2YgGLjtaFr/+ZdHmNxEMFo=; b=ECmWksqLY2C1tbgAeF9jpI3BMZmecV8ztXlQgo26a7iCGcyoe2SroYMfewSo6HLvGZ JXzI2XVHG5eNHcpVPfqdOekwvzB4Ke94DfJZ/TdbD3Z77OGU1X9BwV7gfTcPKuP9d2iA obKZTTw/0gOyyVEOobc68sBPwFmk5d5xnkxKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CahQFBcWvhtigFEizm0+Q2YgGLjtaFr/+ZdHmNxEMFo=; b=P+ovAARguP0gh2KxgelTH5eRxL30ZdZJ8KZo7pGpOCjVJew6oK79Ey0iLhYnAgpjFL LphLG8gVK1k8PQ1nSlOJ6+nuRjoI8n+w9qS5w6B+tZAt7eNQcCA2zDxfMwgbm1vvjP1f UcJEdL/PgwART4Fbf7ff/ra0m/1rYiSu0YZiOmB6Wo9xJci05Zq0hseztsFJ8wz0dHy3 ftDFjItxmUDZa9LuC1eQJct+6XOJyJTbMS74752s2i7PrqOjlSx6+58zeFJ4KN08CM5i LNSFsl70YgASEMYdi/QrOcAf2yKyfHL9iHGiBTbVoSATVT+ggOtAuja4HS6/RUijasex ABkQ== X-Gm-Message-State: AOAM533RYG/g5w8SA3JinEOoOXsouWjP3UJCqh79TZDYyz5t0ywKpI0g Js61OuEPmLOGXw3E0rymqBdL0w== X-Google-Smtp-Source: ABdhPJxBOhP4aHQRY4sXcMd34Pi3anjjiKLHyPPZtcNXh6ULmOdRv2bQZcebnHFyfKOGs+tBah8oXQ== X-Received: by 2002:a92:4b07:: with SMTP id m7mr85642ilg.239.1603674308254; Sun, 25 Oct 2020 18:05:08 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id a6sm5231162ili.11.2020.10.25.18.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 18:05:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH v2 08/30] patman: Fix indenting in patchstream Date: Sun, 25 Oct 2020 19:04:20 -0600 Message-Id: <20201026010442.1606893-9-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026010442.1606893-1-sjg@chromium.org> References: <20201026010442.1606893-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini , Simon Glass , patchwork@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Update the indenting to keep pylint3 happy. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/patchstream.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index ba0a13f6325..5fff74918ab 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -2,6 +2,8 @@ # Copyright (c) 2011 The Chromium OS Authors. # +"""Handles parsing a stream of commits/emails from 'git log' or other source""" + import datetime import math import os @@ -15,8 +17,8 @@ from patman import gitutil from patman.series import Series # Tags that we detect and remove -re_remove = re.compile('^BUG=|^TEST=|^BRANCH=|^Review URL:' - '|Reviewed-on:|Commit-\w*:') +re_remove = re.compile(r'^BUG=|^TEST=|^BRANCH=|^Review URL:' + r'|Reviewed-on:|Commit-\w*:') # Lines which are allowed after a TEST= line re_allowed_after_test = re.compile('^Signed-off-by:') @@ -46,7 +48,7 @@ re_commit = re.compile('^commit ([0-9a-f]*)$') re_space_before_tab = re.compile('^[+].* \t') # Match indented lines for changes -re_leading_whitespace = re.compile('^\s') +re_leading_whitespace = re.compile(r'^\s') # States we can be in - can we use range() and still have comments? STATE_MSG_HEADER = 0 # Still in the message header @@ -149,7 +151,7 @@ class PatchStream: return int(value) except ValueError as str: raise ValueError("%s: Cannot decode version info '%s'" % - (self.commit.hash, line)) + (self.commit.hash, line)) def FinalizeChange(self): """Finalize a (multi-line) change and add it to the series or commit""" @@ -271,7 +273,7 @@ class PatchStream: # If we are not in a section, it is an unexpected END elif line == 'END': - raise ValueError("'END' wihout section") + raise ValueError("'END' wihout section") # Detect the commit subject elif not is_blank and self.state == STATE_PATCH_SUBJECT: @@ -336,8 +338,9 @@ class PatchStream: value = change_id_match.group(1) if self.is_log: if self.commit.change_id: - raise ValueError("%s: Two Change-Ids: '%s' vs. '%s'" % - (self.commit.hash, self.commit.change_id, value)) + raise ValueError( + "%s: Two Change-Ids: '%s' vs. '%s'" % self.commit.hash, + self.commit.change_id, value) self.commit.change_id = value self.skip_blank = True @@ -353,7 +356,7 @@ class PatchStream: self.change_version = self.ParseVersion(value, line) else: self.warn.append('Line %d: Ignoring Commit-%s' % - (self.linenum, name)) + (self.linenum, name)) # Detect the start of a new commit elif commit_match: @@ -376,7 +379,7 @@ class PatchStream: # Suppress duplicate signoffs elif signoff_match: if (self.is_log or not self.commit or - self.commit.CheckDuplicateSignoff(signoff_match.group(1))): + self.commit.CheckDuplicateSignoff(signoff_match.group(1))): out = [line] # Well that means this is an ordinary line @@ -385,7 +388,7 @@ class PatchStream: m = re_space_before_tab.match(line) if m: self.warn.append('Line %d/%d has space before tab' % - (self.linenum, m.start())) + (self.linenum, m.start())) # OK, we have a valid non-blank line out = [line] @@ -418,7 +421,7 @@ class PatchStream: self.CloseCommit() if self.lines_after_test: self.warn.append('Found %d lines after TEST=' % - self.lines_after_test) + self.lines_after_test) def WriteMessageId(self, outfd): """Write the Message-Id into the output. @@ -494,7 +497,7 @@ class PatchStream: else: if self.blank_count and (line == '-- ' or match): self.warn.append("Found possible blank line(s) at " - "end of file '%s'" % last_fname) + "end of file '%s'" % last_fname) outfd.write('+\n' * self.blank_count) outfd.write(line + '\n') self.blank_count = 0 @@ -502,7 +505,7 @@ class PatchStream: def GetMetaDataForList(commit_range, git_dir=None, count=None, - series = None, allow_overwrite=False): + series=None, allow_overwrite=False): """Reads out patch series metadata from the commits This does a 'git log' on the relevant commits and pulls out the tags we