diff --git a/.cruft.json b/.cruft.json index 370c775..e4a4a47 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "git@github.com:bl-sdk/common_dotfiles.git", - "commit": "3d7189e61172cb95877261df8313ae595fe6c02d", + "commit": "cee5c9dbf5b95f57bb636e5138171aa6a4964cf1", "checkout": null, "context": { "cookiecutter": { @@ -16,7 +16,7 @@ "include_cpp": false, "include_py": true, "_template": "git@github.com:bl-sdk/common_dotfiles.git", - "_commit": "3d7189e61172cb95877261df8313ae595fe6c02d" + "_commit": "cee5c9dbf5b95f57bb636e5138171aa6a4964cf1" } }, "directory": null diff --git a/Readme.md b/Readme.md index f41309b..db61718 100644 --- a/Readme.md +++ b/Readme.md @@ -19,6 +19,9 @@ game specific things: # Changelog +### v1.10 +- Linting fixups. + ### v1.9 - Added a new `CoopSupport.HostOnly` value. diff --git a/__init__.py b/__init__.py index c231b3a..c206d99 100644 --- a/__init__.py +++ b/__init__.py @@ -8,7 +8,7 @@ from .dot_sdkmod import open_in_mod_dir # Need to define a few things first to avoid circular imports -__version_info__: tuple[int, int] = (1, 9) +__version_info__: tuple[int, int] = (1, 10) __version__: str = f"{__version_info__[0]}.{__version_info__[1]}" __author__: str = "bl-sdk" diff --git a/hook.py b/hook.py index e02355c..8413231 100644 --- a/hook.py +++ b/hook.py @@ -27,7 +27,7 @@ class HookType[R: PreHookRet | PostHookRet = Any]: __wrapped__: Callable[[UObject, WrappedStruct, Any, BoundFunction], R] hook_identifier: str - hook_funcs: list[tuple[str, Type]] = field(default_factory=list) + hook_funcs: list[tuple[str, Type]] = field(default_factory=list[tuple[str, Type]]) def enable(self) -> None: """Enables all hooks this function is bound to.""" @@ -209,7 +209,7 @@ def decorator(func: HookCallbackFunction[R] | HookCallbackMethod[R]) -> HookType hook: HookType[R] if isinstance(func, HookType): # If we're directly wrapping another hook, use it - hook = func + hook = func # pyright: ignore[reportUnknownVariableType] else: # Look to see if we wrapped another hook function inbetween somewhere wrapped_func = func diff --git a/mod.py b/mod.py index e050a3c..49f72d9 100644 --- a/mod.py +++ b/mod.py @@ -204,7 +204,7 @@ def __post_init__(self) -> None: # noqa: C901 - difficult to split up case BaseOption() if find_options: new_options.append(value) case HookType() if find_hooks: - bound_hook: HookType = value.bind(self) + bound_hook: HookType = value.bind(self) # pyright: ignore[reportUnknownVariableType] new_hooks.append(bound_hook) setattr(self, name, bound_hook) case AbstractCommand() if find_commands: diff --git a/mod_factory.py b/mod_factory.py index 3442c73..099ac41 100644 --- a/mod_factory.py +++ b/mod_factory.py @@ -329,7 +329,7 @@ def update_fields_with_module_search( # noqa: C901 - difficult to split up new_options.append(value) case HookType() if find_hooks: - hook: HookType = value + hook: HookType = value # pyright: ignore[reportUnknownVariableType] new_hooks.append(hook) case AbstractCommand() if find_commands: diff --git a/mod_list.py b/mod_list.py index f09cda8..d13d306 100644 --- a/mod_list.py +++ b/mod_list.py @@ -145,7 +145,7 @@ class ComponentInfo: version: str # They should also all add themselves here, so we can record their versions - components: list[ComponentInfo] = field(default_factory=list) + components: list[ComponentInfo] = field(default_factory=list[ComponentInfo]) # Base mod options get_latest_release_button: ButtonOption = field(init=False) diff --git a/options.py b/options.py index 3e0eba9..26f900e 100644 --- a/options.py +++ b/options.py @@ -165,7 +165,7 @@ class HiddenOption[J: JSON](ValueOption[J]): """ # Need to redefine on change so that it binds to J@HiddenOption, not J@ValueOption - on_change: Callable[[Self, J], None] | None = None + on_change: Callable[[Self, J], None] | None = None # pyright: ignore[reportIncompatibleVariableOverride] is_hidden: Literal[True] = field( # pyright: ignore[reportIncompatibleVariableOverride] default=True,