diff --git a/.flake8 b/.flake8 index bd5f2e22b..f9e0eabd8 100644 --- a/.flake8 +++ b/.flake8 @@ -2,10 +2,6 @@ max-line-length = 300 exclude = lnbits/wallets/lnd_grpc_files/, lnbits/extensions/ ignore = - # E203 whitespace before ':' - E203, - # E221: multiple spaces before operator - E221, # E402: module level import not at top of file E402, # E741 ambiguous variable name diff --git a/lnbits/bolt11.py b/lnbits/bolt11.py index 84bf61e7a..c62bbe5fb 100644 --- a/lnbits/bolt11.py +++ b/lnbits/bolt11.py @@ -50,7 +50,7 @@ def decode(pr: str) -> Invoice: raise ValueError("Too short to contain signature") # extract the signature - signature = bitarray[-65 * 8 :].tobytes() + signature = bitarray[-65 * 8:].tobytes() # the tagged fields as a bitstream data = bitstring.ConstBitStream(bitarray[: -65 * 8]) @@ -61,7 +61,7 @@ def decode(pr: str) -> Invoice: # decode the amount from the hrp m = re.search(r"[^\d]+", hrp[2:]) if m: - amountstr = hrp[2 + m.end() :] + amountstr = hrp[2 + m.end():] if amountstr != "": invoice.amount_msat = _unshorten_amount(amountstr) diff --git a/lnbits/core/migrations.py b/lnbits/core/migrations.py index c19f40afe..4e84ef85e 100644 --- a/lnbits/core/migrations.py +++ b/lnbits/core/migrations.py @@ -109,7 +109,7 @@ async def m002_add_fields_to_apipayments(db): for ext in ["withdraw", "events", "lnticket", "paywall", "tpos"]: prefix = f"#{ext} " if row["memo"].startswith(prefix): - new = row["memo"][len(prefix) :] + new = row["memo"][len(prefix):] await db.execute( """ UPDATE apipayments SET extra = ?, memo = ? diff --git a/lnbits/middleware.py b/lnbits/middleware.py index 93a5671c4..815dbc2fa 100644 --- a/lnbits/middleware.py +++ b/lnbits/middleware.py @@ -125,7 +125,7 @@ class ExtensionsRedirectMiddleware: def _new_path(self, redirect: dict, req_path: str) -> str: from_path = redirect["from_path"].split("/") redirect_to = redirect["redirect_to_path"].split("/") - req_tail_path = req_path.split("/")[len(from_path) :] + req_tail_path = req_path.split("/")[len(from_path):] elements = [ e for e in ([redirect["ext_id"]] + redirect_to + req_tail_path) if e != "" diff --git a/lnbits/wallets/lnbits.py b/lnbits/wallets/lnbits.py index 902711d67..e222b1a1a 100644 --- a/lnbits/wallets/lnbits.py +++ b/lnbits/wallets/lnbits.py @@ -164,7 +164,7 @@ class LNbitsWallet(Wallet): sse_trigger = True continue elif sse_trigger and line.startswith("data:"): - data = json.loads(line[len("data:") :]) + data = json.loads(line[len("data:"):]) sse_trigger = False yield data["payment_hash"] else: diff --git a/lnbits/wallets/lntips.py b/lnbits/wallets/lntips.py index be8159b9c..e6a3275bc 100644 --- a/lnbits/wallets/lntips.py +++ b/lnbits/wallets/lntips.py @@ -155,7 +155,7 @@ class LnTipsWallet(Wallet): prefix = "data: " if not line.startswith(prefix): continue - data = line[len(prefix) :] # sse parsing + data = line[len(prefix):] # sse parsing inv = json.loads(data) if not inv.get("payment_hash"): continue