From ed676945b414c9e2bbcf1b450f8a71b77b09445f Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 7 Aug 2017 00:09:07 +0200 Subject: [PATCH] flake8: Fix all Wxxx whitespace and newline warnings --- hbmqtt/client.py | 2 +- hbmqtt/mqtt/unsuback.py | 2 +- hbmqtt/plugins/__init__.py | 1 - hbmqtt/session.py | 2 +- hbmqtt/version.py | 2 +- scripts/broker_script.py | 2 +- scripts/pub_script.py | 2 +- tests/mqtt/test_pubrec.py | 2 +- tests/mqtt/test_pubrel.py | 2 +- tests/test_codecs.py | 2 +- tox.ini | 3 --- 11 files changed, 9 insertions(+), 13 deletions(-) diff --git a/hbmqtt/client.py b/hbmqtt/client.py index 671068f..a9660bb 100644 --- a/hbmqtt/client.py +++ b/hbmqtt/client.py @@ -345,7 +345,7 @@ class MQTTClient: # Decode URI attributes uri_attributes = urlparse(self.session.broker_uri) scheme = uri_attributes.scheme - secure = True if scheme in ('mqtts', 'wss') else False + secure = True if scheme in ('mqtts', 'wss') else False self.session.username = uri_attributes.username self.session.password = uri_attributes.password self.session.remote_address = uri_attributes.hostname diff --git a/hbmqtt/mqtt/unsuback.py b/hbmqtt/mqtt/unsuback.py index c20b984..a5203f0 100644 --- a/hbmqtt/mqtt/unsuback.py +++ b/hbmqtt/mqtt/unsuback.py @@ -24,4 +24,4 @@ class UnsubackPacket(MQTTPacket): @classmethod def build(cls, packet_id): variable_header = PacketIdVariableHeader(packet_id) - return cls(variable_header=variable_header) \ No newline at end of file + return cls(variable_header=variable_header) diff --git a/hbmqtt/plugins/__init__.py b/hbmqtt/plugins/__init__.py index c8cf453..86831ba 100644 --- a/hbmqtt/plugins/__init__.py +++ b/hbmqtt/plugins/__init__.py @@ -1,4 +1,3 @@ # Copyright (c) 2015 Nicolas JOUANIN # # See the file license.txt for copying permission. - diff --git a/hbmqtt/session.py b/hbmqtt/session.py index ed740bd..3913c33 100644 --- a/hbmqtt/session.py +++ b/hbmqtt/session.py @@ -168,4 +168,4 @@ class Session: self.delivered_message_queue = Queue() def __eq__(self, other): - return self.client_id == other.client_id \ No newline at end of file + return self.client_id == other.client_id diff --git a/hbmqtt/version.py b/hbmqtt/version.py index 37654ee..c3a1223 100644 --- a/hbmqtt/version.py +++ b/hbmqtt/version.py @@ -51,4 +51,4 @@ def get_git_changeset(): timestamp = datetime.datetime.utcfromtimestamp(int(timestamp)) except ValueError: return None - return timestamp.strftime('%Y%m%d%H%M%S') \ No newline at end of file + return timestamp.strftime('%Y%m%d%H%M%S') diff --git a/scripts/broker_script.py b/scripts/broker_script.py index 4d3a95d..9c4a39d 100644 --- a/scripts/broker_script.py +++ b/scripts/broker_script.py @@ -78,4 +78,4 @@ def main(*args, **kwargs): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/scripts/pub_script.py b/scripts/pub_script.py index 1a64017..d68fa26 100644 --- a/scripts/pub_script.py +++ b/scripts/pub_script.py @@ -165,4 +165,4 @@ def main(*args, **kwargs): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/tests/mqtt/test_pubrec.py b/tests/mqtt/test_pubrec.py index ad4a8aa..e1092df 100644 --- a/tests/mqtt/test_pubrec.py +++ b/tests/mqtt/test_pubrec.py @@ -22,4 +22,4 @@ class PubrecPacketTest(unittest.TestCase): variable_header = PacketIdVariableHeader(10) publish = PubrecPacket(variable_header=variable_header) out = publish.to_bytes() - self.assertEqual(out, b'\x50\x02\x00\x0a') \ No newline at end of file + self.assertEqual(out, b'\x50\x02\x00\x0a') diff --git a/tests/mqtt/test_pubrel.py b/tests/mqtt/test_pubrel.py index 0fb707c..516f9d8 100644 --- a/tests/mqtt/test_pubrel.py +++ b/tests/mqtt/test_pubrel.py @@ -22,4 +22,4 @@ class PubrelPacketTest(unittest.TestCase): variable_header = PacketIdVariableHeader(10) publish = PubrelPacket(variable_header=variable_header) out = publish.to_bytes() - self.assertEqual(out, b'\x62\x02\x00\x0a') \ No newline at end of file + self.assertEqual(out, b'\x62\x02\x00\x0a') diff --git a/tests/test_codecs.py b/tests/test_codecs.py index 79393a6..0ae9134 100644 --- a/tests/test_codecs.py +++ b/tests/test_codecs.py @@ -34,4 +34,4 @@ class TestCodecs(unittest.TestCase): def test_encode_string(self): encoded = encode_string('AA') - self.assertEqual(b'\x00\x02AA', encoded) \ No newline at end of file + self.assertEqual(b'\x00\x02AA', encoded) diff --git a/tox.ini b/tox.ini index 535ceb3..27d36ff 100644 --- a/tox.ini +++ b/tox.ini @@ -11,9 +11,6 @@ ignore = F403, # 'from x import *' used; unable to detect undefined names (~29 warnings) F821, # undefined name 'x' (~1 warnings) F841, # local variable 'wildcard_pattern' is assigned to but never used (~17 warnings) - W291, # trailing whitespace (~1 warnings) - W292, # no newline at end of file (~18 warnings) - W391, # blank line at end of file (~1 warnings) E265, # block comment should start with '# ' (~64 warnings) E501, # line too long (~664 warnings) F405, # 'x' may be undefined, or defined from star imports (~401 warnings)