treefmt/ruff: Set python lint version to 3.13. Fix all new lints coming up.

This commit is contained in:
Qubasa
2025-06-30 15:28:15 +07:00
committed by Jörg Thalheim
parent b35ca4f1a8
commit 3f1fdc0aae
10 changed files with 21 additions and 27 deletions

View File

@@ -5,9 +5,9 @@ import shutil
import subprocess as sp
import tempfile
from collections import defaultdict
from collections.abc import Callable, Iterator
from collections.abc import Iterator
from pathlib import Path
from typing import Any, NamedTuple
from typing import NamedTuple
import pytest
from clan_cli.tests import age_keys
@@ -38,7 +38,12 @@ def def_value() -> defaultdict:
return defaultdict(def_value)
nested_dict: Callable[[], dict[str, Any]] = lambda: defaultdict(def_value)
def nested_dict() -> defaultdict:
"""
Creates a defaultdict that allows for arbitrary levels of nesting.
For example: d['a']['b']['c'] = value
"""
return defaultdict(def_value)
# Substitutes strings in a file.

View File

@@ -1,11 +0,0 @@
from collections import defaultdict
from collections.abc import Callable
from typing import Any
def def_value() -> defaultdict:
return defaultdict(def_value)
# allows defining nested dictionary in a single line
nested_dict: Callable[[], dict[str, Any]] = lambda: defaultdict(def_value)