Skip to content

Commit

Permalink
Fix mypy lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanlensky committed Nov 17, 2024
1 parent 08ce8f1 commit c835e2b
Show file tree
Hide file tree
Showing 11 changed files with 318 additions and 262 deletions.
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ dev-dependencies = [
"pyyaml>=6.0.2",
"ruff>=0.7.0",
"types-pyyaml>=6.0.12.20240917",
"types-requests>=2.32.0.20241016",
]

[tool.ruff]
exclude = ["zendriver/cdp"]

[tool.mypy]
exclude = "zendriver/cdp"
check_untyped_defs = true

[[tool.mypy.overrides]]
module = [
"asyncio_atexit",
]
ignore_missing_imports = true
4 changes: 3 additions & 1 deletion scripts/format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/usr/bin/env bash

set -e
set -x

uv run ruff check zendriver --fix
Expand Down
8 changes: 5 additions & 3 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
set -e
set -x

python_files="zendriver scripts"

echo "Running ruff check..."
uv run ruff check zendriver
uv run ruff check $python_files
echo "Running ruff format check..."
uv run ruff format zendriver --check
uv run ruff format $python_files --check
echo "Running mypy..."
uv run mypy zendriver
uv run mypy $python_files
14 changes: 14 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions zendriver/core/_contradict.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import warnings as _warnings
from collections.abc import Mapping as _Mapping, Sequence as _Sequence
import logging
import warnings as _warnings
from collections.abc import Mapping as _Mapping
from collections.abc import Sequence as _Sequence

__logger__ = logging.getLogger(__name__)

Expand Down Expand Up @@ -35,8 +36,6 @@ class ContraDict(dict):
recursive action. dict assignments will be converted too.
"""

__module__ = None

def __init__(self, *args, **kwargs):
super().__init__()
silent = kwargs.pop("silent", False)
Expand Down
Loading

0 comments on commit c835e2b

Please sign in to comment.