Skip to content

Commit 33a21ad

Browse files
authored
Simplify ruff config (#2611)
1 parent 79cc58c commit 33a21ad

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

pymodbus/datastore/simulator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def handle_type_string(self, start, stop, value, action, action_parameters):
219219
def handle_setup_section(self):
220220
"""Load setup section."""
221221
layout = Label.try_get(Label.setup, self.config)
222-
self.runtime.fc_offset = {key: 0 for key in range(25)}
222+
self.runtime.fc_offset = dict.fromkeys(range(25), 0)
223223
size_co = Label.try_get(Label.co_size, layout)
224224
size_di = Label.try_get(Label.di_size, layout)
225225
size_hr = Label.try_get(Label.hr_size, layout)

pymodbus/pdu/device.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ class ModbusCountersHandler:
367367
.. note:: I threw the event counter in here for convenience
368368
"""
369369

370-
__data = {i: 0x0000 for i in range(9)}
370+
__data = dict.fromkeys(range(9), 0x00)
371371
__names = [
372372
"BusMessage",
373373
"BusCommunicationError",
@@ -401,7 +401,7 @@ def update(self, values):
401401

402402
def reset(self):
403403
"""Clear all of the system counters."""
404-
self.__data = {i: 0x0000 for i in range(9)}
404+
self.__data = dict.fromkeys(range(9), 0x00)
405405

406406
def summary(self):
407407
"""Return a summary of the counters current status.

pyproject.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,8 @@ skip = "./build,./doc/source/_static,venv,.venv,.git,htmlcov,CHANGELOG.rst,.mypy
255255
ignore-words-list = "asend"
256256

257257
[tool.ruff]
258-
target-version="py38"
259-
exclude = [
260-
"venv",
261-
".venv",
262-
".git",
258+
target-version="py39"
259+
extend-exclude = [
263260
"build",
264261
"doc",
265262
"contrib"

0 commit comments

Comments
 (0)