Skip to content

Commit bc2ca11

Browse files
committed
mypy: enable some error codes
1 parent 1e5563c commit bc2ca11

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

boostedblob/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
if "pkg_resources" not in sys.modules:
66
# workaround for the following:
77
# https://github.com/benoitc/gunicorn/pull/2539
8-
sys.modules["pkg_resources"] = object() # type: ignore
8+
sys.modules["pkg_resources"] = object() # type: ignore[assignment]
99
import aiohttp
1010

1111
del sys.modules["pkg_resources"]

boostedblob/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
3232

3333

3434
def sync_with_session(fn: F) -> F:
35-
return syncify(bbb.ensure_session(fn)) # type: ignore
35+
return syncify(bbb.ensure_session(fn)) # type: ignore[return-value]
3636

3737

3838
DEFAULT_CONCURRENCY = int(os.environ.get("BBB_DEFAULT_CONCURRENCY", 100))

boostedblob/globals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ async def wrapper(*args: Any, **kwargs: Any) -> Any:
183183
async with session_context():
184184
return await fn(*args, **kwargs)
185185

186-
return wrapper # type: ignore
186+
return wrapper # type: ignore[return-value]
187187

188188

189189
def set_event_loop_exception_handler() -> None:

boostedblob/path.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def relative_to(self: T, other: T) -> str:
4646

4747
def is_relative_to(self: T, other: T) -> bool:
4848
try:
49-
self.relative_to(other) # type: ignore
49+
self.relative_to(other) # type: ignore[attr-defined]
5050
return True
5151
except ValueError:
5252
return False
@@ -249,7 +249,7 @@ def pathdispatch(fn: F) -> F:
249249
causes type checkers to complain about "no attribute register"
250250
251251
"""
252-
ret: F = functools.singledispatch(fn) # type: ignore
252+
ret: F = functools.singledispatch(fn) # type: ignore[assignment]
253253

254254
@ret.register # type: ignore
255255
def strdispatch(path: str, *args: Any, **kwargs: Any) -> Any:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ strict = true
2222
no_warn_return_any = true
2323
python_version = "3.7"
2424
show_error_codes = true
25+
enable_error_code = ["redundant-expr", "truthy-bool"]
2526

2627
[[tool.mypy.overrides]]
2728
module = "tests.*"

0 commit comments

Comments
 (0)