diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c20ae550..4926c628 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,14 +76,10 @@ jobs: - name: Register problem matchers shell: bash run: | - echo "::add-matcher::.github/workflows/matchers/flake8.json" echo "::add-matcher::.github/workflows/matchers/pylint.json" echo "::add-matcher::.github/workflows/matchers/mypy.json" echo "::add-matcher::.github/workflows/matchers/pytest.json" - - run: flake8 aioesphomeapi - name: Lint with flake8 - if: ${{ matrix.python-version == '3.14' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }} - run: ruff format --check aioesphomeapi tests name: Check ruff formatting if: ${{ matrix.python-version == '3.14' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }} diff --git a/.github/workflows/matchers/flake8.json b/.github/workflows/matchers/flake8.json deleted file mode 100644 index e059a1cf..00000000 --- a/.github/workflows/matchers/flake8.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "flake8-error", - "severity": "error", - "pattern": [ - { - "regexp": "^(.*):(\\d+):(\\d+):\\s([EF]\\d{3}\\s.*)$", - "file": 1, - "line": 2, - "column": 3, - "message": 4 - } - ] - }, - { - "owner": "flake8-warning", - "severity": "warning", - "pattern": [ - { - "regexp": "^(.*):(\\d+):(\\d+):\\s([CDNW]\\d{3}\\s.*)$", - "file": 1, - "line": 2, - "column": 3, - "message": 4 - } - ] - } - ] -} diff --git a/aioesphomeapi/__init__.py b/aioesphomeapi/__init__.py index fe013d7c..e6f5f006 100644 --- a/aioesphomeapi/__init__.py +++ b/aioesphomeapi/__init__.py @@ -1,5 +1,5 @@ -# flake8: noqa -from .api_pb2 import ( # type: ignore[attr-defined] # noqa: F401 +# ruff: noqa: F401, F403 +from .api_pb2 import ( # type: ignore[attr-defined] BluetoothLERawAdvertisement, BluetoothLERawAdvertisementsResponse, ) @@ -10,20 +10,20 @@ ESPHOME_GATT_ERRORS, MESSAGE_TYPE_TO_PROTO, APIConnectionError, - EncryptionPlaintextAPIError, + BadMACAddressAPIError, BadNameAPIError, BluetoothConnectionDroppedError, + EncryptionHelloAPIError, + EncryptionPlaintextAPIError, HandshakeAPIError, InvalidAuthAPIError, InvalidEncryptionKeyAPIError, ProtocolAPIError, RequiresEncryptionAPIError, ResolveAPIError, - EncryptionHelloAPIError, SocketAPIError, - BadMACAddressAPIError, wifi_mac_to_bluetooth_mac, ) +from .log_parser import LogParser, parse_log_message from .model import * from .reconnect_logic import ReconnectLogic -from .log_parser import parse_log_message, LogParser diff --git a/requirements/test.txt b/requirements/test.txt index 5b62002e..0b7b3c33 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,6 +1,5 @@ pylint==4.0.5 ruff==0.15.13 -flake8==7.3.0 isort==8.0.1 mypy==2.1.0 types-protobuf==7.34.1.20260518 diff --git a/script/lint b/script/lint index 762bd105..9f02f387 100755 --- a/script/lint +++ b/script/lint @@ -5,7 +5,8 @@ set -euxo pipefail black --safe aioesphomeapi tests pylint aioesphomeapi -flake8 aioesphomeapi +ruff check aioesphomeapi tests +ruff format --check aioesphomeapi tests isort aioesphomeapi tests mypy aioesphomeapi pytest tests diff --git a/setup.cfg b/setup.cfg index bca74820..2a9acf13 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,18 +1,2 @@ -[flake8] -max-line-length = 120 -# Following 4 for black compatibility -# E501: line too long -# W503: Line break occurred before a binary operator -# E203: Whitespace before ':' -# D202 No blank lines allowed after function docstring - -ignore = - E501, - W503, - E203, - D202, - -exclude = api_pb2.py, api_options_pb2.py - [bdist_wheel] universal = 1