From 2d12b7e50da420f71fc01a22a621cc62be33b840 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Wed, 10 Sep 2025 22:21:47 -0400 Subject: [PATCH] addressed RUF059 linting fixes against codebase (#1413) --- apprise/plugins/matrix.py | 10 +++++----- apprise/plugins/ntfy.py | 4 ++-- apprise/plugins/pushsafer.py | 4 ++-- apprise/plugins/reddit.py | 2 +- apprise/plugins/revolt.py | 2 +- apprise/plugins/sendpulse.py | 2 +- apprise/plugins/ses.py | 2 +- apprise/plugins/sparkpost.py | 2 +- apprise/plugins/twist.py | 4 ++-- apprise/plugins/twitter.py | 2 +- tests/test_plugin_matrix.py | 6 +++--- tests/test_plugin_signal.py | 4 ++-- tests/test_plugin_title_maxlen.py | 4 ++-- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apprise/plugins/matrix.py b/apprise/plugins/matrix.py index b10c110e..62f00706 100644 --- a/apprise/plugins/matrix.py +++ b/apprise/plugins/matrix.py @@ -732,7 +732,7 @@ class NotifyMatrix(NotifyBase): } # Post our content - postokay, response = self._fetch( + postokay, _response = self._fetch( path, payload=image_payload) if not postokay: # Mark our failure @@ -744,7 +744,7 @@ class NotifyMatrix(NotifyBase): attachment["room_id"] = room_id attachment["type"] = "m.room.message" - postokay, response = self._fetch( + postokay, _response = self._fetch( path, payload=attachment, method=method) # Increment the transaction ID to avoid future messages @@ -804,7 +804,7 @@ class NotifyMatrix(NotifyBase): }) # Post our content - postokay, response = self._fetch( + postokay, _response = self._fetch( path, payload=payload, method=method ) @@ -1814,7 +1814,7 @@ class NotifyMatrix(NotifyBase): # verify_url = f"{base_url}/_matrix/client/versions" # Post our content - code, response = self._fetch( + code, _response = self._fetch( None, method="GET", url_override=verify_url ) if code != requests.codes.ok: @@ -1856,7 +1856,7 @@ class NotifyMatrix(NotifyBase): verify_url = f"{identity_url}/_matrix/identity/v2" # Post our content - code, response = self._fetch( + code, _response = self._fetch( None, method="GET", url_override=verify_url ) if code != requests.codes.ok: diff --git a/apprise/plugins/ntfy.py b/apprise/plugins/ntfy.py index 9dd6d937..6ebd4756 100644 --- a/apprise/plugins/ntfy.py +++ b/apprise/plugins/ntfy.py @@ -478,7 +478,7 @@ class NotifyNtfy(NotifyBase): f" {attachment.url(privacy=True)}" ) - okay, response = self._send( + okay, _response = self._send( topic, body=_body, title=_title, @@ -490,7 +490,7 @@ class NotifyNtfy(NotifyBase): return False else: # Send our Notification Message - okay, response = self._send( + okay, _response = self._send( topic, body=body, title=title, image_url=image_url ) if not okay: diff --git a/apprise/plugins/pushsafer.py b/apprise/plugins/pushsafer.py index 87b110e8..abba9494 100644 --- a/apprise/plugins/pushsafer.py +++ b/apprise/plugins/pushsafer.py @@ -657,7 +657,7 @@ class NotifyPushSafer(NotifyBase): payload["v"] = str(self.vibration) if not attachments: - okay, response = self._send(payload) + okay, _response = self._send(payload) if not okay: has_error = True continue @@ -685,7 +685,7 @@ class NotifyPushSafer(NotifyBase): f'Added attachment ({filename}) to "{recipient}".' ) - okay, response = self._send(_payload) + okay, _response = self._send(_payload) if not okay: has_error = True continue diff --git a/apprise/plugins/reddit.py b/apprise/plugins/reddit.py index fa9991e3..d2728471 100644 --- a/apprise/plugins/reddit.py +++ b/apprise/plugins/reddit.py @@ -527,7 +527,7 @@ class NotifyReddit(NotifyBase): "text": body, }) - postokay, response = self._fetch(self.submit_url, payload=payload) + postokay, _response = self._fetch(self.submit_url, payload=payload) # only toggle has_error flag if we had an error if not postokay: # Mark our failure diff --git a/apprise/plugins/revolt.py b/apprise/plugins/revolt.py index 7420a578..90ad7b39 100644 --- a/apprise/plugins/revolt.py +++ b/apprise/plugins/revolt.py @@ -212,7 +212,7 @@ class NotifyRevolt(NotifyBase): has_error = False channel_ids = list(self.targets) for channel_id in channel_ids: - postokay, response = self._send(payload, channel_id) + postokay, _response = self._send(payload, channel_id) if not postokay: # Failed to send message has_error = True diff --git a/apprise/plugins/sendpulse.py b/apprise/plugins/sendpulse.py index 821f53dd..f39e24b5 100644 --- a/apprise/plugins/sendpulse.py +++ b/apprise/plugins/sendpulse.py @@ -573,7 +573,7 @@ class NotifySendPulse(NotifyBase): payload["email"]["bcc"].append(item) # Perform our post - success, response = self._fetch( + success, _response = self._fetch( self.notify_email_url, payload, target, retry=1) if not success: has_error = True diff --git a/apprise/plugins/ses.py b/apprise/plugins/ses.py index 01b53092..692b1125 100644 --- a/apprise/plugins/ses.py +++ b/apprise/plugins/ses.py @@ -542,7 +542,7 @@ class NotifySES(NotifyBase): quote(from_name, " "), quote(self.from_addr, "@ ") ) - (result, response) = self._post(payload=payload, to=to_addr) + (result, _response) = self._post(payload=payload, to=to_addr) if not result: # Mark our failure has_error = True diff --git a/apprise/plugins/sparkpost.py b/apprise/plugins/sparkpost.py index 5c62d004..020220f2 100644 --- a/apprise/plugins/sparkpost.py +++ b/apprise/plugins/sparkpost.py @@ -684,7 +684,7 @@ class NotifySparkPost(NotifyBase): payload["content"]["headers"] = headers # Send our message - status_code, response = self.__post( + status_code, _response = self.__post( payload, self.sparkpost_retry_attempts ) diff --git a/apprise/plugins/twist.py b/apprise/plugins/twist.py index e4547e65..9090ee3c 100644 --- a/apprise/plugins/twist.py +++ b/apprise/plugins/twist.py @@ -369,7 +369,7 @@ class NotifyTwist(NotifyBase): return True # Send Logout Message - postokay, response = self._fetch("users/logout") + _postokay, _response = self._fetch("users/logout") # reset our token self.token = None @@ -600,7 +600,7 @@ class NotifyTwist(NotifyBase): "content": body, } - postokay, response = self._fetch( + postokay, _response = self._fetch( "threads/add", payload=payload, ) diff --git a/apprise/plugins/twitter.py b/apprise/plugins/twitter.py index f290d35a..dcf93b16 100644 --- a/apprise/plugins/twitter.py +++ b/apprise/plugins/twitter.py @@ -584,7 +584,7 @@ class NotifyTwitter(NotifyBase): target["recipient_id"] = user_id # Send Twitter DM - postokay, response = self._fetch( + postokay, _response = self._fetch( self.twitter_dm, payload=payload, ) diff --git a/tests/test_plugin_matrix.py b/tests/test_plugin_matrix.py index fba3bc68..d8c4f763 100644 --- a/tests/test_plugin_matrix.py +++ b/tests/test_plugin_matrix.py @@ -585,7 +585,7 @@ def test_plugin_matrix_fetch(mock_post, mock_get, mock_put): "retry_after_ms": 1, }) - code, response = obj._fetch("/retry/apprise/unit/test") + code, _response = obj._fetch("/retry/apprise/unit/test") assert code is False request.content = dumps( @@ -595,11 +595,11 @@ def test_plugin_matrix_fetch(mock_post, mock_get, mock_put): } } ) - code, response = obj._fetch("/retry/apprise/unit/test") + code, _response = obj._fetch("/retry/apprise/unit/test") assert code is False request.content = dumps({"error": {}}) - code, response = obj._fetch("/retry/apprise/unit/test") + code, _response = obj._fetch("/retry/apprise/unit/test") assert code is False del obj diff --git a/tests/test_plugin_signal.py b/tests/test_plugin_signal.py index 27ffaa8d..7455d135 100644 --- a/tests/test_plugin_signal.py +++ b/tests/test_plugin_signal.py @@ -277,7 +277,7 @@ def test_plugin_signal_yaml_config(request_mock): """NotifySignalAPI() YAML Configuration.""" # Load our configuration - result, config = ConfigBase.config_parse_yaml(cleandoc(""" + result, _ = ConfigBase.config_parse_yaml(cleandoc(""" urls: - signal://signal:8080/+1234567890: - to: +0987654321 @@ -301,7 +301,7 @@ def test_plugin_signal_yaml_config(request_mock): # # Load our configuration - result, config = ConfigBase.config_parse_yaml(cleandoc(""" + result, _config = ConfigBase.config_parse_yaml(cleandoc(""" urls: - signal://signal:8080/+1234567890/+0987654321: - tag: signal diff --git a/tests/test_plugin_title_maxlen.py b/tests/test_plugin_title_maxlen.py index ac0e2364..54db4ab2 100644 --- a/tests/test_plugin_title_maxlen.py +++ b/tests/test_plugin_title_maxlen.py @@ -57,7 +57,7 @@ def request_mock(mocker): def test_plugin_title_maxlen(request_mock): """Plugin title maxlen blending support.""" # Load our configuration - result, config = ConfigBase.config_parse_yaml(cleandoc(""" + result, _ = ConfigBase.config_parse_yaml(cleandoc(""" urls: # Our JSON plugin allows for a title definition; we enforce a html format @@ -103,7 +103,7 @@ def test_plugin_title_maxlen(request_mock): # # Reverse the configuration file and expect the same results # - result, config = ConfigBase.config_parse_yaml(cleandoc(""" + result, _config = ConfigBase.config_parse_yaml(cleandoc(""" urls: # Telegram has a title_maxlen of 0