Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some code quality and bug-risk issues #1379

Merged
merged 1 commit into from May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions .deepsource.toml
@@ -0,0 +1,19 @@
version = 1

test_patterns = [
"*/test/**",
"*/test/**/*.py"
]

exclude_patterns = [
"twisted/plugins/**",
"examples/**"
]

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"

2 changes: 1 addition & 1 deletion autobahn/asyncio/component.py
Expand Up @@ -55,7 +55,7 @@ def _unique_list(seq):

def _camel_case_from_snake_case(snake):
parts = snake.split('_')
return parts[0] + ''.join([s.capitalize() for s in parts[1:]])
return parts[0] + ''.join(s.capitalize() for s in parts[1:])


def _create_transport_factory(loop, transport, session_factory):
Expand Down
2 changes: 1 addition & 1 deletion autobahn/asyncio/websocket.py
Expand Up @@ -93,7 +93,7 @@ def _consume(self):
self.waiter = Future(loop=self.factory.loop or txaio.config.loop)

def process(_):
while len(self.receive_queue):
while self.receive_queue:
data = self.receive_queue.popleft()
if self.transport:
self._dataReceived(data)
Expand Down
2 changes: 1 addition & 1 deletion autobahn/twisted/component.py
Expand Up @@ -67,7 +67,7 @@ def _unique_list(seq):

def _camel_case_from_snake_case(snake):
parts = snake.split('_')
return parts[0] + ''.join([s.capitalize() for s in parts[1:]])
return parts[0] + ''.join(s.capitalize() for s in parts[1:])


def _create_transport_factory(reactor, transport, session_factory):
Expand Down
2 changes: 1 addition & 1 deletion autobahn/wamp/auth.py
Expand Up @@ -579,7 +579,7 @@ def generate_wcs(length=14):
:rtype: bytes
"""
assert(type(length) == int)
return "".join([random.choice(WCS_SECRET_CHARSET) for _ in range(length)]).encode('ascii')
return "".join(random.choice(WCS_SECRET_CHARSET) for _ in range(length)).encode('ascii')


@public
Expand Down
4 changes: 3 additions & 1 deletion autobahn/wamp/component.py
Expand Up @@ -268,9 +268,11 @@ def __init__(self, idx, kind, url, endpoint, serializers,
retry_delay_growth=1.5,
retry_delay_jitter=0.1,
proxy=None,
options=dict()):
options=None):
"""
"""
if options is None:
options = dict()
self.idx = idx

self.type = kind
Expand Down
2 changes: 1 addition & 1 deletion autobahn/wamp/cryptosign.py
Expand Up @@ -183,7 +183,7 @@ def _read_ssh_ed25519_privkey(keydata):

ssh_end = keydata.find(SSH_END)
keydata = keydata[len(SSH_BEGIN):ssh_end]
keydata = ''.join([x.strip() for x in keydata.split()])
keydata = ''.join(x.strip() for x in keydata.split())
blob = binascii.a2b_base64(keydata)

blob = blob[len(OPENSSH_KEY_V1):]
Expand Down