Skip to content
Snippets Groups Projects
Commit d4a032c4 authored by Moul's avatar Moul
Browse files

Bump black, pyupgrade, and pre-commit-hooks pre-commit hooks

Apply Black changes
parent 4e5fe108
Branches
Tags
1 merge request!182Bump rte, test, hooks, doc dependencies
exclude: ^docs/ exclude: ^docs/
repos: repos:
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 22.10.0 rev: 23.3.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/PyCQA/isort - repo: https://github.com/PyCQA/isort
...@@ -21,12 +21,12 @@ repos: ...@@ -21,12 +21,12 @@ repos:
hooks: hooks:
- id: pylint - id: pylint
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.3.1 rev: v3.4.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py38-plus] args: [--py38-plus]
- repo: https://github.com/Lucas-C/pre-commit-hooks - repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1 rev: v1.5.1
hooks: hooks:
- id: insert-license - id: insert-license
files: \.py$ files: \.py$
......
...@@ -65,7 +65,6 @@ def get_available_nodes(client: Client) -> List[List[Dict[str, Any]]]: ...@@ -65,7 +65,6 @@ def get_available_nodes(client: Client) -> List[List[Dict[str, Any]]]:
for _, group in groupby(heads, key=lambda x: x.block_id): for _, group in groupby(heads, key=lambda x: x.block_id):
nodes = [] nodes = []
for head in list(group): for head in list(group):
# if head signature not valid... # if head signature not valid...
if head.check_signature(head.pubkey) is False: if head.check_signature(head.pubkey) is False:
# skip this node # skip this node
......
...@@ -50,7 +50,6 @@ def handshake( ...@@ -50,7 +50,6 @@ def handshake(
remote_connect_document = None remote_connect_document = None
# Iterate on each message received... # Iterate on each message received...
while loop: while loop:
data = ws.receive_json() data = ws.receive_json()
if "auth" in data and data["auth"] == "CONNECT": if "auth" in data and data["auth"] == "CONNECT":
......
...@@ -304,7 +304,6 @@ class AsciiArmor: ...@@ -304,7 +304,6 @@ class AsciiArmor:
# parse each line... # parse each line...
for line in ascii_armor_message.splitlines(True): for line in ascii_armor_message.splitlines(True):
# if begin message header detected... # if begin message header detected...
if regex_begin_message.match(line): if regex_begin_message.match(line):
cursor_status = ON_MESSAGE_FIELDS cursor_status = ON_MESSAGE_FIELDS
...@@ -328,13 +327,10 @@ class AsciiArmor: ...@@ -328,13 +327,10 @@ class AsciiArmor:
# if we are on the message content lines... # if we are on the message content lines...
if cursor_status == ON_MESSAGE_CONTENT: if cursor_status == ON_MESSAGE_CONTENT:
# if a header is detected, end of message content... # if a header is detected, end of message content...
if line.startswith(HEADER_PREFIX): if line.startswith(HEADER_PREFIX):
# if field Version is present, the message is encrypted... # if field Version is present, the message is encrypted...
if "Version" in parsed_result["message"]["fields"]: if "Version" in parsed_result["message"]["fields"]:
# If keypair instance to decrypt not given... # If keypair instance to decrypt not given...
if signing_key is None: if signing_key is None:
# SigningKey keypair is mandatory to decrypt the message... # SigningKey keypair is mandatory to decrypt the message...
...@@ -368,7 +364,6 @@ class AsciiArmor: ...@@ -368,7 +364,6 @@ class AsciiArmor:
# if we are on a signature fields zone... # if we are on a signature fields zone...
if cursor_status == ON_SIGNATURE_FIELDS: if cursor_status == ON_SIGNATURE_FIELDS:
# parse field # parse field
m = regex_fields.match(line.strip()) m = regex_fields.match(line.strip())
if m: if m:
...@@ -387,7 +382,6 @@ class AsciiArmor: ...@@ -387,7 +382,6 @@ class AsciiArmor:
# if we are on the signature content... # if we are on the signature content...
if cursor_status == ON_SIGNATURE_CONTENT: if cursor_status == ON_SIGNATURE_CONTENT:
# if no public keys provided... # if no public keys provided...
if sender_pubkeys is None: if sender_pubkeys is None:
# raise exception # raise exception
......
...@@ -24,7 +24,6 @@ headv1_tor = "" ...@@ -24,7 +24,6 @@ headv1_tor = ""
class TestWS2PHeads(unittest.TestCase): class TestWS2PHeads(unittest.TestCase):
def test_headv0(self): def test_headv0(self):
inline = "WS2P:HEAD:3dnbnYY9i2bHMQUGyFp5GVvJ2wBkVpus31cDJA5cfRpj:54813-00000A24802B33B71A91B6E990038C145A4815A45C71E57B2F2EF393183C7E2C" inline = "WS2P:HEAD:3dnbnYY9i2bHMQUGyFp5GVvJ2wBkVpus31cDJA5cfRpj:54813-00000A24802B33B71A91B6E990038C145A4815A45C71E57B2F2EF393183C7E2C"
signature = "a1vAAM666kPsMCFTbkgkcCsqHf8nmXR+Lh3D3u+BaXzmArj7kwlItbdGUs4fc9QUG5Lp4TwPS7nhOM5t1Kt6CA==" signature = "a1vAAM666kPsMCFTbkgkcCsqHf8nmXR+Lh3D3u+BaXzmArj7kwlItbdGUs4fc9QUG5Lp4TwPS7nhOM5t1Kt6CA=="
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment