From patchwork Fri Oct 30 03:46:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1390742 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 4CMpGy6hWxz9sSf for ; Fri, 30 Oct 2020 14:50:02 +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=S0jUNsEc; 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 4CMpGy5vrczDqCF for ; Fri, 30 Oct 2020 14:50:02 +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::141; helo=mail-il1-x141.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=S0jUNsEc; dkim-atps=neutral Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 4CMpCL6TSmzDqtY for ; Fri, 30 Oct 2020 14:46:54 +1100 (AEDT) Received: by mail-il1-x141.google.com with SMTP id x7so5354149ili.5 for ; Thu, 29 Oct 2020 20:46:54 -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=dXxOR8q8YE8W1Y6Bidj8U/MJdri+DLe6mRbJ+87LDBg=; b=S0jUNsEcJVqotztHuGzY1C2/JMzGW8RlFrbdvBXd3VnyXjZvxYIhvM7l3QRnuyMJo3 R7u1MiaKzTExcJJH4mq3eOlqd9zQoK8fRX1HRjFNsPv3Q5JVhofgUWilo2r4qD5zOOVL YPdRNT1soLuEYdgJ63mRuwmvD83CWVqBppjuw= 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=dXxOR8q8YE8W1Y6Bidj8U/MJdri+DLe6mRbJ+87LDBg=; b=D1Oo14DyGPGjhPbtKSw8BFOHURgA0BoOOTU66MuitTud6jGv3yM14GMHj0s77KosEJ ZvHFJkkaEkFKBBiLaGtjU8pE/5CZ/XzrIyCCFCAwMX5dyvvDMjPTlfEeG2BnLfwt4Haw KVSd4fiHhKqYsYO3Dt0JRWYgM7mJFUbTW+3ALl7U3KglAPHOeHnqtTBuozNCJfMc1ecp 14uaXTimHJXVjtAHwM4AyaeQp5rTmQhJAs2TU5Bhkj0DSjUocG5SZdjXPlF2O7gI/1bQ gtHYC+FzS0/oj86+TerElsbD8cXxEYco5x2kzjKlUNsN/KwAwhvI1EjJlakrWKdMKWJP TqzQ== X-Gm-Message-State: AOAM530hphlhj9WM4WNlekQrnHOwwtydUTyDZ7z2RzTYnr0TVtBhOSOE hvuCa8tfPHNjvyqJT83UolaOFkJYVMXYATti X-Google-Smtp-Source: ABdhPJwuC629KkUHVKzte/Gl8ehvrRI4HmIsjh5LZlturLZ/LZFKkc6OY7bcCo19v+3G5JLi5qaoLg== X-Received: by 2002:a92:bb8d:: with SMTP id x13mr478229ilk.225.1604029613033; Thu, 29 Oct 2020 20:46:53 -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 n28sm4858693ila.52.2020.10.29.20.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 20:46:52 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH v3 09/29] patman: Fix constant style in patchstream Date: Thu, 29 Oct 2020 21:46:18 -0600 Message-Id: <20201030034638.2858999-10-sjg@chromium.org> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog In-Reply-To: <20201030034638.2858999-1-sjg@chromium.org> References: <20201030034638.2858999-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: patchwork@lists.ozlabs.org, Simon Glass , Tom Rini Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" These constants should use upper case. Update them to keep pylint3 happy. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/patchstream.py | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 5fff74918ab..86b03a7a30b 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -17,38 +17,38 @@ from patman import gitutil from patman.series import Series # Tags that we detect and remove -re_remove = re.compile(r'^BUG=|^TEST=|^BRANCH=|^Review URL:' +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:') +RE_ALLOWED_AFTER_TEST = re.compile('^Signed-off-by:') # Signoffs -re_signoff = re.compile('^Signed-off-by: *(.*)') +RE_SIGNOFF = re.compile('^Signed-off-by: *(.*)') # Cover letter tag -re_cover = re.compile('^Cover-([a-z-]*): *(.*)') +RE_COVER = re.compile('^Cover-([a-z-]*): *(.*)') # Patch series tag -re_series_tag = re.compile('^Series-([a-z-]*): *(.*)') +RE_SERIES_TAG = re.compile('^Series-([a-z-]*): *(.*)') # Change-Id will be used to generate the Message-Id and then be stripped -re_change_id = re.compile('^Change-Id: *(.*)') +RE_CHANGE_ID = re.compile('^Change-Id: *(.*)') # Commit series tag -re_commit_tag = re.compile('^Commit-([a-z-]*): *(.*)') +RE_COMMIT_TAG = re.compile('^Commit-([a-z-]*): *(.*)') # Commit tags that we want to collect and keep -re_tag = re.compile('^(Tested-by|Acked-by|Reviewed-by|Patch-cc|Fixes): (.*)') +RE_TAG = re.compile('^(Tested-by|Acked-by|Reviewed-by|Patch-cc|Fixes): (.*)') # The start of a new commit in the git log -re_commit = re.compile('^commit ([0-9a-f]*)$') +RE_COMMIT = re.compile('^commit ([0-9a-f]*)$') # We detect these since checkpatch doesn't always do it -re_space_before_tab = re.compile('^[+].* \t') +RE_SPACE_BEFORE_TAB = re.compile('^[+].* \t') # Match indented lines for changes -re_leading_whitespace = re.compile(r'^\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 @@ -195,22 +195,22 @@ class PatchStream: out = [] line = line.rstrip('\n') - commit_match = re_commit.match(line) if self.is_log else None + commit_match = RE_COMMIT.match(line) if self.is_log else None if self.is_log: if line[:4] == ' ': line = line[4:] # Handle state transition and skipping blank lines - series_tag_match = re_series_tag.match(line) - change_id_match = re_change_id.match(line) - commit_tag_match = re_commit_tag.match(line) - cover_match = re_cover.match(line) - signoff_match = re_signoff.match(line) - leading_whitespace_match = re_leading_whitespace.match(line) + series_tag_match = RE_SERIES_TAG.match(line) + change_id_match = RE_CHANGE_ID.match(line) + commit_tag_match = RE_COMMIT_TAG.match(line) + cover_match = RE_COVER.match(line) + signoff_match = RE_SIGNOFF.match(line) + leading_whitespace_match = RE_LEADING_WHITESPACE.match(line) tag_match = None if self.state == STATE_PATCH_HEADER: - tag_match = re_tag.match(line) + tag_match = RE_TAG.match(line) is_blank = not line.strip() if is_blank: if (self.state == STATE_MSG_HEADER @@ -280,7 +280,7 @@ class PatchStream: self.commit.subject = line # Detect the tags we want to remove, and skip blank lines - elif re_remove.match(line) and not commit_tag_match: + elif RE_REMOVE.match(line) and not commit_tag_match: self.skip_blank = True # TEST= should be the last thing in the commit, so remove @@ -385,7 +385,7 @@ class PatchStream: # Well that means this is an ordinary line else: # Look for space before tab - m = re_space_before_tab.match(line) + m = RE_SPACE_BEFORE_TAB.match(line) if m: self.warn.append('Line %d/%d has space before tab' % (self.linenum, m.start())) @@ -410,7 +410,7 @@ class PatchStream: out += self.commit.notes out += [''] + log elif self.found_test: - if not re_allowed_after_test.match(line): + if not RE_ALLOWED_AFTER_TEST.match(line): self.lines_after_test += 1 return out