diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e5d5a4a2ad171f9b2a35dc124851049cb30e6712..951ac5bf2252bc0b8813c05ddb223065468edeb4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ exclude: ^docs/ repos: - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/PyCQA/isort @@ -21,12 +21,12 @@ repos: hooks: - id: pylint - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.4.0 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.3.1 + rev: v1.5.1 hooks: - id: insert-license files: \.py$ diff --git a/duniterpy/helpers/network.py b/duniterpy/helpers/network.py index 33ea37fc596d2ab8717d9746b98cc7776c2b8ed4..2fab4417fdf168b6f4271be6e5e4938905211d76 100644 --- a/duniterpy/helpers/network.py +++ b/duniterpy/helpers/network.py @@ -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): nodes = [] for head in list(group): - # if head signature not valid... if head.check_signature(head.pubkey) is False: # skip this node diff --git a/duniterpy/helpers/ws2p.py b/duniterpy/helpers/ws2p.py index 5e8f49fae29d6555742bed216ce2ff72d120791b..e4bc899e5357655c3d56a19de72f6362c6085ff2 100644 --- a/duniterpy/helpers/ws2p.py +++ b/duniterpy/helpers/ws2p.py @@ -50,7 +50,6 @@ def handshake( remote_connect_document = None # Iterate on each message received... while loop: - data = ws.receive_json() if "auth" in data and data["auth"] == "CONNECT": diff --git a/duniterpy/key/ascii_armor.py b/duniterpy/key/ascii_armor.py index 80fef25108b00985c242679332cd4be5cf664d5e..9ab3efe47b0224179926f04bc3c2be03674fbccd 100644 --- a/duniterpy/key/ascii_armor.py +++ b/duniterpy/key/ascii_armor.py @@ -304,7 +304,6 @@ class AsciiArmor: # parse each line... for line in ascii_armor_message.splitlines(True): - # if begin message header detected... if regex_begin_message.match(line): cursor_status = ON_MESSAGE_FIELDS @@ -328,13 +327,10 @@ class AsciiArmor: # if we are on the message content lines... if cursor_status == ON_MESSAGE_CONTENT: - # if a header is detected, end of message content... if line.startswith(HEADER_PREFIX): - # if field Version is present, the message is encrypted... if "Version" in parsed_result["message"]["fields"]: - # If keypair instance to decrypt not given... if signing_key is None: # SigningKey keypair is mandatory to decrypt the message... @@ -368,7 +364,6 @@ class AsciiArmor: # if we are on a signature fields zone... if cursor_status == ON_SIGNATURE_FIELDS: - # parse field m = regex_fields.match(line.strip()) if m: @@ -387,7 +382,6 @@ class AsciiArmor: # if we are on the signature content... if cursor_status == ON_SIGNATURE_CONTENT: - # if no public keys provided... if sender_pubkeys is None: # raise exception diff --git a/tests/documents/test_ws2p_heads.py b/tests/documents/test_ws2p_heads.py index 1a5dc01258b701e8b9fb1c6585a10d0fe908f423..83ac402b69abe19ad8c8f894f41327ceaae84fd2 100644 --- a/tests/documents/test_ws2p_heads.py +++ b/tests/documents/test_ws2p_heads.py @@ -24,7 +24,6 @@ headv1_tor = "" class TestWS2PHeads(unittest.TestCase): def test_headv0(self): - inline = "WS2P:HEAD:3dnbnYY9i2bHMQUGyFp5GVvJ2wBkVpus31cDJA5cfRpj:54813-00000A24802B33B71A91B6E990038C145A4815A45C71E57B2F2EF393183C7E2C" signature = "a1vAAM666kPsMCFTbkgkcCsqHf8nmXR+Lh3D3u+BaXzmArj7kwlItbdGUs4fc9QUG5Lp4TwPS7nhOM5t1Kt6CA=="