From b9520cbc258fa2072b9ad7f4c262a79ef2fc7dd8 Mon Sep 17 00:00:00 2001 From: Joe Testa Date: Mon, 10 Oct 2022 20:40:29 -0400 Subject: [PATCH] Fixed pylint & flake8 warnings and errors. --- src/ssh_audit/ssh_socket.py | 2 +- test/test_policy.py | 8 ++++---- tox.ini | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ssh_audit/ssh_socket.py b/src/ssh_audit/ssh_socket.py index 6853c1c..566612c 100644 --- a/src/ssh_audit/ssh_socket.py +++ b/src/ssh_audit/ssh_socket.py @@ -325,7 +325,7 @@ class SSH_Socket(ReadBuf, WriteBuf): self.__header = [] self.__banner = None - def _close_socket(self, s: Optional[socket.socket]) -> None: # pylint: disable=no-self-use + def _close_socket(self, s: Optional[socket.socket]) -> None: try: if s is not None: s.shutdown(socket.SHUT_RDWR) diff --git a/test/test_policy.py b/test/test_policy.py index b78fab2..a008b81 100644 --- a/test/test_policy.py +++ b/test/test_policy.py @@ -41,15 +41,15 @@ class TestPolicy: for policy_name in Policy.BUILTIN_POLICIES: # Ensure that the policy name ends with " (version X)", where X is the 'version' field. version_str = " (version %s)" % Policy.BUILTIN_POLICIES[policy_name]['version'] - assert(policy_name.endswith(version_str)) + assert policy_name.endswith(version_str) # Ensure that each built-in policy can be loaded with Policy.load_builtin_policy(). - assert(Policy.load_builtin_policy(policy_name) is not None) + assert Policy.load_builtin_policy(policy_name) is not None # Ensure that both server and client policy names are returned. server_policy_names, client_policy_names = Policy.list_builtin_policies() - assert(len(server_policy_names) > 0) - assert(len(client_policy_names) > 0) + assert len(server_policy_names) > 0 + assert len(client_policy_names) > 0 def test_policy_basic(self): diff --git a/tox.ini b/tox.ini index c74632a..baffcf8 100644 --- a/tox.ini +++ b/tox.ini @@ -91,14 +91,12 @@ reports = no #output-format = colorized indent-string = " " disable = - bad-continuation, broad-except, duplicate-code, fixme, invalid-name, line-too-long, missing-docstring, - mixed-indentation, no-else-raise, no-else-return, super-with-arguments, # Can be re-factored, at some point.