Skip to content

Commit

Permalink
Replace pylint.extensions.mccabe with ruff (C)omplexity rule
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 committed Apr 24, 2023
1 parent 0c8a50b commit a25de7f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pymodbus/repl/server/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def print_title():
)


async def interactive_shell(server): # pylint: disable=too-complex
async def interactive_shell(server):
"""Run CLI interactive shell."""
print_title()
info("")
Expand Down Expand Up @@ -158,7 +158,7 @@ async def interactive_shell(server): # pylint: disable=too-complex
return


def _process_args(args) -> dict: # pylint: disable=too-complex
def _process_args(args) -> dict:
"""Process arguments passed to CLI."""
skip_next = False
val_dict = {}
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/server/async_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def connection_lost(self, call_exc):
traceback.format_exc(),
)

async def handle(self): # pylint: disable=too-complex
async def handle(self):
"""Return Asyncio coroutine which represents a single conversation.
between the modbus slave and master
Expand Down
4 changes: 2 additions & 2 deletions pymodbus/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _validate_response(self, request, response, exp_resp_len):
return mbap.get("length") == exp_resp_len
return True

def execute(self, request): # pylint: disable=too-complex
def execute(self, request): # noqa: C901
"""Start the producer to send the next request to consumer.write(Frame(request))."""
with self._transaction_lock:
try:
Expand Down Expand Up @@ -332,7 +332,7 @@ def _send(self, packet, _retrying=False):
"""Send."""
return self.client.framer.sendPacket(packet)

def _recv(self, expected_response_length, full): # pylint: disable=too-complex
def _recv(self, expected_response_length, full): # noqa: C901
"""Receive."""
total = None
if not full:
Expand Down
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ select = [
"PGH", # pygrep-hooks
# "TRY", # tryceratops
# "B", # bandit
# "C", # complexity
"C", # complexity
]
[pydocstyle]
convention = "pep257"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ load-plugins=
pylint.extensions.emptystring,
pylint.extensions.eq_without_hash,
pylint.extensions.for_any_all,
pylint.extensions.mccabe,
pylint.extensions.overlapping_exceptions,
pylint.extensions.private_import,
pylint.extensions.set_membership,
pylint.extensions.typing,
# NOT WANTED:
# pylint.extensions.mccabe, (replaced by ruff)
# pylint.extensions.broad_try_clause,
# pylint.extensions.consider_ternary_expression,
# pylint.extensions.empty_comment,
Expand Down

0 comments on commit a25de7f

Please sign in to comment.