Skip to content

Commit dc32bd4

Browse files
authored
Remove flake8 and replace with ruff (esphome#1686)
1 parent 40ef803 commit dc32bd4

6 files changed

Lines changed: 8 additions & 58 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,10 @@ jobs:
7676
- name: Register problem matchers
7777
shell: bash
7878
run: |
79-
echo "::add-matcher::.github/workflows/matchers/flake8.json"
8079
echo "::add-matcher::.github/workflows/matchers/pylint.json"
8180
echo "::add-matcher::.github/workflows/matchers/mypy.json"
8281
echo "::add-matcher::.github/workflows/matchers/pytest.json"
8382
84-
- run: flake8 aioesphomeapi
85-
name: Lint with flake8
86-
if: ${{ matrix.python-version == '3.14' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }}
8783
- run: ruff format --check aioesphomeapi tests
8884
name: Check ruff formatting
8985
if: ${{ matrix.python-version == '3.14' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }}

.github/workflows/matchers/flake8.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

aioesphomeapi/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# flake8: noqa
2-
from .api_pb2 import ( # type: ignore[attr-defined] # noqa: F401
1+
# ruff: noqa: F401, F403
2+
from .api_pb2 import ( # type: ignore[attr-defined]
33
BluetoothLERawAdvertisement,
44
BluetoothLERawAdvertisementsResponse,
55
)
@@ -10,20 +10,20 @@
1010
ESPHOME_GATT_ERRORS,
1111
MESSAGE_TYPE_TO_PROTO,
1212
APIConnectionError,
13-
EncryptionPlaintextAPIError,
13+
BadMACAddressAPIError,
1414
BadNameAPIError,
1515
BluetoothConnectionDroppedError,
16+
EncryptionHelloAPIError,
17+
EncryptionPlaintextAPIError,
1618
HandshakeAPIError,
1719
InvalidAuthAPIError,
1820
InvalidEncryptionKeyAPIError,
1921
ProtocolAPIError,
2022
RequiresEncryptionAPIError,
2123
ResolveAPIError,
22-
EncryptionHelloAPIError,
2324
SocketAPIError,
24-
BadMACAddressAPIError,
2525
wifi_mac_to_bluetooth_mac,
2626
)
27+
from .log_parser import LogParser, parse_log_message
2728
from .model import *
2829
from .reconnect_logic import ReconnectLogic
29-
from .log_parser import parse_log_message, LogParser

requirements/test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pylint==4.0.5
22
ruff==0.15.13
3-
flake8==7.3.0
43
isort==8.0.1
54
mypy==2.1.0
65
types-protobuf==7.34.1.20260518

script/lint

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ set -euxo pipefail
55

66
black --safe aioesphomeapi tests
77
pylint aioesphomeapi
8-
flake8 aioesphomeapi
8+
ruff check aioesphomeapi tests
9+
ruff format --check aioesphomeapi tests
910
isort aioesphomeapi tests
1011
mypy aioesphomeapi
1112
pytest tests

setup.cfg

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
1-
[flake8]
2-
max-line-length = 120
3-
# Following 4 for black compatibility
4-
# E501: line too long
5-
# W503: Line break occurred before a binary operator
6-
# E203: Whitespace before ':'
7-
# D202 No blank lines allowed after function docstring
8-
9-
ignore =
10-
E501,
11-
W503,
12-
E203,
13-
D202,
14-
15-
exclude = api_pb2.py, api_options_pb2.py
16-
171
[bdist_wheel]
182
universal = 1

0 commit comments

Comments
 (0)