ci: Configure isort and make it happy

This commit is contained in:
Gergely Polonkai 2023-10-29 10:47:21 +01:00
parent d28ca167f2
commit 95039914ba
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4
7 changed files with 21 additions and 7 deletions

View File

@ -30,3 +30,9 @@ repos:
language: system language: system
types: [python] types: [python]
require_serial: true require_serial: true
- id: isort
name: isort
entry: poetry run isort
language: system
require_serial: true
types_or: [python, pyi]

View File

@ -1,11 +1,11 @@
"""Example SHS client""" """Example SHS client"""
import os
from asyncio import get_event_loop from asyncio import get_event_loop
from base64 import b64decode from base64 import b64decode
import os
import yaml
from nacl.signing import SigningKey from nacl.signing import SigningKey
import yaml
from secret_handshake import SHSClient from secret_handshake import SHSClient

View File

@ -1,11 +1,11 @@
"""Example SHS server""" """Example SHS server"""
import os
from asyncio import get_event_loop from asyncio import get_event_loop
from base64 import b64decode from base64 import b64decode
import os
import yaml
from nacl.signing import SigningKey from nacl.signing import SigningKey
import yaml
from secret_handshake import SHSServer from secret_handshake import SHSServer

View File

@ -51,6 +51,11 @@ skip_covered = true
fail_under = 91 fail_under = 91
omit = ["examples/*"] omit = ["examples/*"]
[tool.isort]
force_sort_within_sections = true
line_length = 100
profile = "black"
[tool.pylint.format] [tool.pylint.format]
max-line-length = 120 max-line-length = 120

View File

@ -42,7 +42,10 @@ class AsyncBuffer(BytesIO):
async def async_comprehend(generator): async def async_comprehend(generator):
"""Emulate ``[elem async for elem in generator]``.""" """Emulate ``[elem async for elem in generator]``."""
results = [] results = []
async for msg in generator: async for msg in generator:
results.append(msg) results.append(msg)
return results return results

View File

@ -22,9 +22,9 @@
import hashlib import hashlib
import pytest
from nacl.public import PrivateKey from nacl.public import PrivateKey
from nacl.signing import SigningKey from nacl.signing import SigningKey
import pytest
from secret_handshake.crypto import SHSClientCrypto, SHSServerCrypto from secret_handshake.crypto import SHSClientCrypto, SHSServerCrypto

View File

@ -20,11 +20,11 @@
"""Tests for the networking components""" """Tests for the networking components"""
import os
from asyncio import Event, wait_for from asyncio import Event, wait_for
import os
import pytest
from nacl.signing import SigningKey from nacl.signing import SigningKey
import pytest
from secret_handshake import SHSClient, SHSServer from secret_handshake import SHSClient, SHSServer