Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit d9e787b

Browse files
committed
fix: Flake8 updates
1 parent 4206873 commit d9e787b

File tree

8 files changed

+33
-29
lines changed

8 files changed

+33
-29
lines changed

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
use_djcelery = True
4545
try:
4646
import djcelery # NOQA
47-
#INSTALLED_APPS.append('djcelery')
47+
# INSTALLED_APPS.append('djcelery')
4848
except ImportError:
4949
use_djcelery = False
5050

raven/base.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,12 @@ def __init__(self, dsn=None, raise_send_errors=False, transport=None,
173173
self.include_paths = set(o.get('include_paths') or [])
174174
self.exclude_paths = set(o.get('exclude_paths') or [])
175175
self.name = text_type(
176-
o.get('name') or os.environ.get('SENTRY_NAME') or
177-
o.get('machine') or defaults.NAME)
176+
o.get('name') or os.environ.get('SENTRY_NAME')
177+
or o.get('machine') or defaults.NAME
178+
)
178179
self.auto_log_stacks = bool(
179-
o.get('auto_log_stacks') or defaults.AUTO_LOG_STACKS)
180+
o.get('auto_log_stacks') or defaults.AUTO_LOG_STACKS
181+
)
180182
self.capture_locals = bool(
181183
o.get('capture_locals', defaults.CAPTURE_LOCALS))
182184
self.string_max_length = int(
@@ -198,8 +200,8 @@ def __init__(self, dsn=None, raise_send_errors=False, transport=None,
198200
self.environment = (
199201
o.get('environment') or os.environ.get('SENTRY_ENVIRONMENT', None))
200202
self.release = (
201-
o.get('release') or os.environ.get('SENTRY_RELEASE') or
202-
os.environ.get('HEROKU_SLUG_COMMIT'))
203+
o.get('release') or os.environ.get('SENTRY_RELEASE')
204+
or os.environ.get('HEROKU_SLUG_COMMIT'))
203205
self.repos = self._format_repos(o.get('repos'))
204206
self.sample_rate = (
205207
o.get('sample_rate')
@@ -435,8 +437,8 @@ def build_msg(self, event_type, data=None, date=None,
435437
frame['in_app'] = False
436438
else:
437439
frame['in_app'] = (
438-
any(path.startswith(x) for x in self.include_paths) and
439-
not any(path.startswith(x) for x in self.exclude_paths)
440+
any(path.startswith(x) for x in self.include_paths)
441+
and not any(path.startswith(x) for x in self.exclude_paths)
440442
)
441443

442444
transaction = None

raven/breadcrumbs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727

2828
def event_payload_considered_equal(a, b):
2929
return (
30-
a['type'] == b['type'] and
31-
a['level'] == b['level'] and
32-
a['message'] == b['message'] and
33-
a['category'] == b['category'] and
34-
a['data'] == b['data']
30+
a['type'] == b['type']
31+
and a['level'] == b['level']
32+
and a['message'] == b['message']
33+
and a['category'] == b['category']
34+
and a['data'] == b['data']
3535
)
3636

3737

raven/contrib/django/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ def capture(self, event_type, request=None, **kwargs):
288288
# template information. As of Django 1.9 or so the new
289289
# template debug thing showed up.
290290
if hasattr(exc_value, 'django_template_source') or \
291-
((isinstance(exc_value, TemplateSyntaxError) and
292-
isinstance(getattr(exc_value, 'source', None),
293-
(tuple, list)) and
294-
isinstance(exc_value.source[0], Origin))) or \
291+
((isinstance(exc_value, TemplateSyntaxError)
292+
and isinstance(getattr(exc_value, 'source', None),
293+
(tuple, list))
294+
and isinstance(exc_value.source[0], Origin))) or \
295295
hasattr(exc_value, 'template_debug'):
296296
source = getattr(exc_value, 'django_template_source',
297297
getattr(exc_value, 'source', None))

raven/contrib/django/serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def can(self, value):
2525
return False
2626

2727
pre = value.__class__.__name__[1:]
28-
if not (hasattr(value, '%s__func' % pre) or
29-
hasattr(value, '%s__unicode_cast' % pre) or
30-
hasattr(value, '%s__text_cast' % pre)):
28+
if not (hasattr(value, '%s__func' % pre)
29+
or hasattr(value, '%s__unicode_cast' % pre)
30+
or hasattr(value, '%s__text_cast' % pre)):
3131
return False
3232

3333
return True

raven/contrib/zope/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def __init__(self, *args, **kw):
4646

4747
def can_record(self, record):
4848
return not (
49-
record.name == 'raven' or
50-
record.name.startswith(('sentry.errors', 'raven.'))
49+
record.name == 'raven'
50+
or record.name.startswith(('sentry.errors', 'raven.'))
5151
)
5252

5353
def emit(self, record):

raven/handlers/logging.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def __init__(self, *args, **kwargs):
8181

8282
def can_record(self, record):
8383
return not (
84-
record.name == 'raven' or
85-
record.name.startswith(('sentry.errors', 'raven.'))
84+
record.name == 'raven'
85+
or record.name.startswith(('sentry.errors', 'raven.'))
8686
)
8787

8888
def emit(self, record):
@@ -119,8 +119,10 @@ def _get_targetted_stack(self, stack, record):
119119
if not started:
120120
f_globals = getattr(frame, 'f_globals', {})
121121
module_name = f_globals.get('__name__', '')
122-
if ((last_mod and last_mod.startswith('logging')) and
123-
not module_name.startswith('logging')):
122+
if (
123+
last_mod and last_mod.startswith('logging')
124+
and not module_name.startswith('logging')
125+
):
124126
started = True
125127
else:
126128
last_mod = module_name

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@
9292
'anyjson',
9393
'ZConfig',
9494
] + (
95-
flask_requires + flask_tests_requires +
96-
sanic_requires + sanic_tests_requires +
97-
unittest2_requires + webpy_tests_requires
95+
flask_requires + flask_tests_requires
96+
+ sanic_requires + sanic_tests_requires
97+
+ unittest2_requires + webpy_tests_requires
9898
)
9999

100100

0 commit comments

Comments
 (0)