aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2023-02-02 09:39:24 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2023-02-02 09:39:24 -0500
commitada3021c64dd484e53219eb3af55da6c8f25d0ec (patch)
treee5ec5eb2badef4a553461db7eb3706a82ed1c0d1
parenta3281834d6d5dec44f58071fca2d22e04a97fe18 (diff)
downloadb4-ada3021c64dd484e53219eb3af55da6c8f25d0ec.tar.gz
PEP inspection cleanups
Very minor whitespace and visual indentation cleanups to appease PEP inspections. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py5
-rw-r--r--b4/command.py8
-rw-r--r--b4/ez.py2
-rw-r--r--b4/pr.py4
4 files changed, 10 insertions, 9 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index bcacc1a..4d5a6c9 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -1438,7 +1438,7 @@ class LoreMessage:
transform: Literal['encode', 'decode', 'preserve'] = 'preserve') -> bytes:
hname, hval = hdr
if hname.lower() in ('to', 'cc', 'from', 'x-original-from'):
- _parts = [f'{hname}: ',]
+ _parts = [f'{hname}: ']
first = True
for addr in email.utils.getaddresses([hval]):
if transform == 'encode' and not addr[0].isascii():
@@ -1493,7 +1493,7 @@ class LoreMessage:
return f'{nl} '.join(_parts).encode()
@staticmethod
- def get_msg_as_bytes(msg: email.message.Message, nl: str ='\n',
+ def get_msg_as_bytes(msg: email.message.Message, nl: str = '\n',
headers: Literal['encode', 'decode', 'preserve'] = 'preserve') -> bytes:
bdata = b''
for hname, hval in msg.items():
@@ -3563,6 +3563,7 @@ def retrieve_messages(cmdargs: argparse.Namespace) -> Tuple[Optional[str], Optio
return msgid, msgs
+
def git_revparse_obj(gitobj: str) -> str:
ecode, out = git_run_command(None, ['rev-parse', gitobj])
if ecode > 0:
diff --git a/b4/command.py b/b4/command.py
index 05e05f5..a7a5aa9 100644
--- a/b4/command.py
+++ b/b4/command.py
@@ -176,7 +176,7 @@ def setup_parser() -> argparse.ArgumentParser:
help=('(use with -H or -M) When guessing base, go back this many days from the patch date '
'(default: 3 weeks)'))
sp_sh.add_argument('--merge-base', dest='mergebase', type=str, default=None,
- help=('(use with -H or -M) Force this base when merging'))
+ help='(use with -H or -M) Force this base when merging')
sp_sh.set_defaults(func=cmd_shazam)
# b4 pr
@@ -260,11 +260,11 @@ def setup_parser() -> argparse.ArgumentParser:
# b4 prep
sp_prep = subparsers.add_parser('prep', help='Work on patch series to submit for mailing list review')
sp_prep.add_argument('-c', '--auto-to-cc', action='store_true', default=False,
- help='Automatically populate cover letter trailers with To and Cc addresses')
+ help='Automatically populate cover letter trailers with To and Cc addresses')
sp_prep.add_argument('--force-revision', metavar='N', type=int,
- help='Force revision to be this number instead')
+ help='Force revision to be this number instead')
sp_prep.add_argument('--set-prefixes', metavar='PREFIX', nargs='+',
- help='Extra prefixes to add to [PATCH] (e.g.: RFC mydrv)')
+ help='Extra prefixes to add to [PATCH] (e.g.: RFC mydrv)')
spp_g = sp_prep.add_mutually_exclusive_group()
spp_g.add_argument('-p', '--format-patch', metavar='OUTPUT_DIR',
diff --git a/b4/ez.py b/b4/ez.py
index 68a8e70..74afddc 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -1101,7 +1101,7 @@ def get_cover_subject_body(cover: str) -> Tuple[b4.LoreSubject, str]:
def rethread(patches: List[Tuple[str, email.message.Message]]):
- refto = patches[0][1].get('message-id')
+ refto = patches[0][1].get('message-id')
for commit, msg in patches[1:]:
msg.add_header('References', refto)
msg.add_header('In-Reply-To', refto)
diff --git a/b4/pr.py b/b4/pr.py
index cbc92c2..6c01e2b 100644
--- a/b4/pr.py
+++ b/b4/pr.py
@@ -19,7 +19,7 @@ import gzip
import urllib.parse
import requests
-from datetime import datetime, timedelta
+from datetime import datetime
from email import utils, charset
from email.mime.text import MIMEText
@@ -358,7 +358,7 @@ def explode(gitdir: Optional[str], lmsg: b4.LoreMessage, mailfrom: Optional[str]
msg.add_header('X-Original-List-Id', b4.LoreMessage.clean_header(lmsg.msg['List-Id']))
msgs.append(msg)
- logger.info(' %s', re.sub(r'\n\s*', ' ' , msg.get('Subject')))
+ logger.info(' %s', re.sub(r'\n\s*', ' ', msg.get('Subject')))
logger.info('Exploded %s messages', len(msgs))
if retrieve_links and linked_ids: