diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 66ef2e2..287df15 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,12 +9,12 @@ ci: repos: - repo: https://github.com/commitizen-tools/commitizen - rev: v4.16.5 + rev: v4.19.0 hooks: - id: commitizen stages: [commit-msg] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: debug-statements - id: check-builtin-literals @@ -28,11 +28,11 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.25.3" + rev: "v2.29.4" hooks: - id: pyproject-fmt - repo: https://github.com/python-poetry/poetry - rev: 2.4.1 + rev: 2.5.1 hooks: - id: poetry-check - repo: https://github.com/pre-commit/mirrors-prettier @@ -41,7 +41,7 @@ repos: - id: prettier args: ["--tab-width", "2"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.10 + rev: v0.16.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes] @@ -52,7 +52,7 @@ repos: - id: codespell args: [-L, astroid] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.2 + rev: v2.3.1 hooks: - id: mypy additional_dependencies: [types-pyyaml, strenum] diff --git a/README.md b/README.md index 185bbf7..7be502e 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,11 @@ $ account-codes-jp list --type blue-return ``` ```python -from account_codes_jp import get_blue_return_accounts, get_account_type_factory, AccountType +from account_codes_jp import ( + get_blue_return_accounts, + get_account_type_factory, + AccountType, +) G = get_blue_return_accounts() t = get_account_type_factory(G) diff --git a/src/account_codes_jp/_blue_return.py b/src/account_codes_jp/_blue_return.py index 2d977eb..1724791 100644 --- a/src/account_codes_jp/_blue_return.py +++ b/src/account_codes_jp/_blue_return.py @@ -38,7 +38,7 @@ def from_nested_dict( if isinstance(grandchildren, Mapping): q.append((id_child, grandchildren)) elif isinstance(grandchildren, list): - q.append((id_child, {k: None for k in grandchildren})) + q.append((id_child, dict.fromkeys(grandchildren))) return G diff --git a/tests/test_dunder_main.py b/tests/test_dunder_main.py index 843c490..1979168 100644 --- a/tests/test_dunder_main.py +++ b/tests/test_dunder_main.py @@ -4,7 +4,7 @@ def test_can_run_as_python_module(): """Run the CLI as a Python module.""" - result = subprocess.run( # noqa: S603 + result = subprocess.run( [sys.executable, "-m", "account_codes_jp", "--help"], check=True, capture_output=True,