Skip to content

Commit 6f7b66e

Browse files
Enable isort rules in ruff (#1485)
Co-authored-by: jan iversen <[email protected]>
1 parent 20a2556 commit 6f7b66e

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ repos:
1010
- id: end-of-file-fixer
1111
- id: check-yaml
1212
- id: check-added-large-files
13-
- repo: https://github.com/pycqa/isort
14-
rev: 5.12.0
15-
hooks:
16-
- id: isort
17-
exclude: ^(doc/_build|venv|.venv|.git|pymodbus/client/serial_asyncio)
1813
# run ruff with --fix before black
1914
- repo: https://github.com/charliermarsh/ruff-pre-commit
2015
rev: 'v0.0.261'

pymodbus/factory.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,13 @@
8484
ReportSlaveIdRequest,
8585
ReportSlaveIdResponse,
8686
)
87-
from pymodbus.pdu import ExceptionResponse, IllegalFunctionRequest
87+
from pymodbus.pdu import (
88+
ExceptionResponse,
89+
IllegalFunctionRequest,
90+
ModbusRequest,
91+
ModbusResponse,
92+
)
8893
from pymodbus.pdu import ModbusExceptions as ecode
89-
from pymodbus.pdu import ModbusRequest, ModbusResponse
9094
from pymodbus.register_read_message import (
9195
ReadHoldingRegistersRequest,
9296
ReadHoldingRegistersResponse,

ruff.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ select = [
2626
"SIM300",
2727
"SIM401",
2828
"RUF",
29+
"I",
2930
"U",
3031
]
3132
[pydocstyle]
3233
convention = "pep257"
34+
[isort]
35+
lines-after-imports = 2
36+
known-local-folder = [
37+
"common",
38+
"contrib",
39+
]

0 commit comments

Comments
 (0)