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 bug risks and code quality issues #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version = 1

test_patterns = ["test/**"]

exclude_patterns = ["docs/**"]

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

[analyzers.meta]
runtime_version = "3.x.x"
2 changes: 1 addition & 1 deletion aardvark/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _prep_accounts(account_names):
Considers account aliases as well as account names.
Returns a list of account numbers
"""
matching_accounts = list()
matching_accounts = []
account_names = account_names.split(',')
account_names = {name.lower().strip() for name in account_names}

Expand Down
3 changes: 2 additions & 1 deletion aardvark/updater/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import absolute_import

import copy
import sys
import time

from blinker import Signal
Expand Down Expand Up @@ -45,7 +46,7 @@ def update_account(self):

if not arns:
self.current_app.logger.warn("Zero ARNs collected. Exiting")
exit(-1)
sys.exit(-1)

client = self._get_client()
try:
Expand Down
3 changes: 1 addition & 2 deletions aardvark/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import better_exceptions # noqa
import datetime
import json

from flask import abort, jsonify
from flask import Blueprint
Expand Down Expand Up @@ -32,7 +31,7 @@ def combine(self, aa):
del aa['page']
del aa['total']

usage = dict()
usage = {}
for arn, services in aa.items():
for service in services:
namespace = service.get('serviceNamespace')
Expand Down
2 changes: 1 addition & 1 deletion test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def tearDown(self):
if self.last_transcript:
fptr.write(
'\n'.join(
map(lambda x: str(x), self.last_transcript)
map(str, self.last_transcript)
) + '\n'
)

Expand Down