Skip to content

Commit

Permalink
Add mypy options
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise committed Aug 22, 2024
1 parent ce1aa9f commit dcda12c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ repos:
language: system
types: [ python ]
require_serial: true
exclude: "test"

- repo: local
hooks:
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ exclude = [
profile = "black"

[tool.mypy]
exclude = ["test"]
ignore_missing_imports = true
python_version = "3.10"
disallow_untyped_defs = true
disallow_incomplete_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true

[[tool.mypy.overrides]]
module = "sw_utils.ssz.*"
Expand Down
2 changes: 1 addition & 1 deletion sw_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __enter__(self) -> 'InterruptHandler':
signal.signal(signal.SIGTERM, self.exit_gracefully)
return self

def __exit__(self, exc_type, exc_val, exc_tb):
def __exit__(self, exc_type, exc_val, exc_tb): # type: ignore
signal.signal(signal.SIGINT, self.exit_default)
signal.signal(signal.SIGTERM, self.exit_default)

Expand Down
4 changes: 2 additions & 2 deletions sw_utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def safe(func: Callable) -> Callable:
if asyncio.iscoroutinefunction(func):

@wraps(func)
async def wrapper(*args, **kwargs):
async def wrapper(*args, **kwargs): # type: ignore
try:
return await func(*args, **kwargs)
except BaseException as e:
Expand All @@ -32,7 +32,7 @@ async def wrapper(*args, **kwargs):
else:

@wraps(func)
def wrapper(*args, **kwargs):
def wrapper(*args, **kwargs): # type: ignore
try:
return func(*args, **kwargs)
except BaseException as e:
Expand Down

0 comments on commit dcda12c

Please sign in to comment.