Skip to content

Commit 8b0b539

Browse files
ref: upgrade linters to flake8 5.x
1 parent 033b236 commit 8b0b539

File tree

12 files changed

+25
-25
lines changed

12 files changed

+25
-25
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ repos:
1212
hooks:
1313
- id: black
1414

15-
- repo: https://gitlab.com/pycqa/flake8
16-
rev: 3.9.2
15+
- repo: https://github.com/pycqa/flake8
16+
rev: 5.0.4
1717
hooks:
1818
- id: flake8
1919

linter-requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
black==22.3.0
2-
flake8==3.9.2
2+
flake8==5.0.4
33
flake8-import-order==0.18.1
44
mypy==0.961
55
types-certifi
66
types-redis
77
types-setuptools
8-
flake8-bugbear==21.4.3
9-
pep8-naming==0.13.0
8+
flake8-bugbear==22.9.11
9+
pep8-naming==0.13.2
1010
pre-commit # local linting

sentry_sdk/_compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
PY2 = sys.version_info[0] == 2
1616

1717
if PY2:
18-
import urlparse # noqa
18+
import urlparse
1919

2020
text_type = unicode # noqa
2121

@@ -39,7 +39,7 @@ def implements_str(cls):
3939
text_type = str
4040
string_types = (text_type,) # type: Tuple[type]
4141
number_types = (int, float) # type: Tuple[type, type]
42-
int_types = (int,) # noqa
42+
int_types = (int,)
4343
iteritems = lambda x: x.items()
4444

4545
def implements_str(x):

sentry_sdk/api.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def add_breadcrumb(
108108

109109

110110
@overload
111-
def configure_scope(): # noqa: F811
111+
def configure_scope():
112112
# type: () -> ContextManager[Scope]
113113
pass
114114

@@ -130,7 +130,7 @@ def configure_scope( # noqa: F811
130130

131131

132132
@overload
133-
def push_scope(): # noqa: F811
133+
def push_scope():
134134
# type: () -> ContextManager[Scope]
135135
pass
136136

@@ -151,31 +151,31 @@ def push_scope( # noqa: F811
151151
return Hub.current.push_scope(callback)
152152

153153

154-
@scopemethod # noqa
154+
@scopemethod
155155
def set_tag(key, value):
156156
# type: (str, Any) -> None
157157
return Hub.current.scope.set_tag(key, value)
158158

159159

160-
@scopemethod # noqa
160+
@scopemethod
161161
def set_context(key, value):
162162
# type: (str, Dict[str, Any]) -> None
163163
return Hub.current.scope.set_context(key, value)
164164

165165

166-
@scopemethod # noqa
166+
@scopemethod
167167
def set_extra(key, value):
168168
# type: (str, Any) -> None
169169
return Hub.current.scope.set_extra(key, value)
170170

171171

172-
@scopemethod # noqa
172+
@scopemethod
173173
def set_user(value):
174174
# type: (Optional[Dict[str, Any]]) -> None
175175
return Hub.current.scope.set_user(value)
176176

177177

178-
@scopemethod # noqa
178+
@scopemethod
179179
def set_level(value):
180180
# type: (str) -> None
181181
return Hub.current.scope.set_level(value)

sentry_sdk/hub.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def start_transaction(
546546
return transaction
547547

548548
@overload
549-
def push_scope( # noqa: F811
549+
def push_scope(
550550
self, callback=None # type: Optional[None]
551551
):
552552
# type: (...) -> ContextManager[Scope]
@@ -595,7 +595,7 @@ def pop_scope_unsafe(self):
595595
return rv
596596

597597
@overload
598-
def configure_scope( # noqa: F811
598+
def configure_scope(
599599
self, callback=None # type: Optional[None]
600600
):
601601
# type: (...) -> ContextManager[Scope]
@@ -610,7 +610,7 @@ def configure_scope( # noqa: F811
610610

611611
def configure_scope( # noqa
612612
self, callback=None # type: Optional[Callable[[Scope], None]]
613-
): # noqa
613+
):
614614
# type: (...) -> Optional[ContextManager[Scope]]
615615

616616
"""

sentry_sdk/integrations/serverless.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def overload(x):
2727

2828

2929
@overload
30-
def serverless_function(f, flush=True): # noqa: F811
30+
def serverless_function(f, flush=True):
3131
# type: (F, bool) -> F
3232
pass
3333

sentry_sdk/integrations/starlette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
try:
5050
# Optional dependency of Starlette to parse form data.
51-
import multipart # type: ignore # noqa: F401
51+
import multipart # type: ignore
5252
except ImportError:
5353
multipart = None
5454

sentry_sdk/profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from sentry_sdk.utils import logger
2323

2424
if PY2:
25-
import thread # noqa
25+
import thread
2626
else:
2727
import threading
2828

sentry_sdk/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ def _get_contextvars():
861861
# `aiocontextvars` is absolutely required for functional
862862
# contextvars on Python 3.6.
863863
try:
864-
from aiocontextvars import ContextVar # noqa
864+
from aiocontextvars import ContextVar
865865

866866
return True, ContextVar
867867
except ImportError:

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def __init__(self, substring):
400400
try:
401401
# the `unicode` type only exists in python 2, so if this blows up,
402402
# we must be in py3 and have the `bytes` type
403-
self.valid_types = (str, unicode) # noqa
403+
self.valid_types = (str, unicode)
404404
except NameError:
405405
self.valid_types = (str, bytes)
406406

tests/integrations/aiohttp/test_aiohttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ async def test_traces_sampler_gets_request_object_in_sampling_context(
249249
sentry_init,
250250
aiohttp_client,
251251
DictionaryContaining, # noqa:N803
252-
ObjectDescribedBy, # noqa:N803
252+
ObjectDescribedBy,
253253
):
254254
traces_sampler = mock.Mock()
255255
sentry_init(

tests/integrations/aws_lambda/test_aws.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,8 @@ def test_handler(event, context):
523523
def test_traces_sampler_gets_correct_values_in_sampling_context(
524524
run_lambda_function,
525525
DictionaryContaining, # noqa:N803
526-
ObjectDescribedBy, # noqa:N803
527-
StringContaining, # noqa:N803
526+
ObjectDescribedBy,
527+
StringContaining,
528528
):
529529
# TODO: This whole thing is a little hacky, specifically around the need to
530530
# get `conftest.py` code into the AWS runtime, which is why there's both

0 commit comments

Comments
 (0)