Skip to content

Commit

Permalink
Minor cleanup for DeepSource
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Feb 13, 2020
1 parent a64f908 commit 5011e8d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions coaster/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def emit(self, record):
):

# Sanity check:
# If we're not going to be reporting this, don't bother to format the payload
# If we're not going to be reporting this, don't bother to format payload
if record.levelname not in [
lname
for webhook in self.webhooks
Expand All @@ -242,8 +242,8 @@ def emit(self, record):
s.split('----') for s in record.exc_text.split('----------')
]
flat_list = [item for sublist in double_split for item in sublist]
# Separate out the first line of each section. It'll be used as the "pretext"
# while the rest will be used as a "text" attachment.
# Separate out the first line of each section. It'll be used as the
# "pretext" while the rest will be used as a "text" attachment.
sections = [s.strip().split('\n', 1) for s in flat_list]
else:
sections = []
Expand Down Expand Up @@ -283,8 +283,8 @@ def emit(self, record):
headers={'Content-Type': 'application/json'},
)
except: # NOQA # nosec
# We need a bare except clause because this is the exception handler.
# It can't have exceptions of its own.
# We need a bare except clause because this is the exception
# handler. It can't have exceptions of its own.
pass
error_throttle_timestamp_slack[throttle_key] = datetime.utcnow()

Expand Down
1 change: 1 addition & 0 deletions coaster/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def sync_resources():


def shell_context():
"""Supplies context variables for the shell"""
context = {'app': manager.app, 'db': manager.db, 'flask': flask}
context.update(manager.context)
return context
Expand Down
2 changes: 1 addition & 1 deletion coaster/views/classview.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __call__(self, decorated):
self.name = self.func.__name__
# self.endpoint will change once init_app calls __set_name__
self.endpoint = self.name
self.__doc__ = self.func.__doc__
self.__doc__ = self.func.__doc__ # skipcq: PYL-W0201
return self

# Normally Python 3.6+, but called manually by :meth:`ClassView.init_app`
Expand Down

0 comments on commit 5011e8d

Please sign in to comment.