diff --git a/pyproject.toml b/pyproject.toml index e4ce81da8..1dba38e2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,7 @@ exclude = [ [tool.mypy] disallow_untyped_defs = false disallow_incomplete_defs = false +enable_error_code = ["ignore-without-code"] follow_imports = "normal" ignore_missing_imports = true pretty = true diff --git a/src/hatch/env/collectors/custom.py b/src/hatch/env/collectors/custom.py index 287c3a938..bfbc11a6f 100644 --- a/src/hatch/env/collectors/custom.py +++ b/src/hatch/env/collectors/custom.py @@ -11,7 +11,7 @@ class CustomEnvironmentCollector: PLUGIN_NAME = 'custom' - def __new__( # type: ignore + def __new__( # type: ignore[misc] cls, root: str, config: dict[str, Any], diff --git a/src/hatch/env/collectors/plugin/hooks.py b/src/hatch/env/collectors/plugin/hooks.py index 7ba66683b..102368835 100644 --- a/src/hatch/env/collectors/plugin/hooks.py +++ b/src/hatch/env/collectors/plugin/hooks.py @@ -12,4 +12,4 @@ @hookimpl def hatch_register_environment_collector() -> list[type[EnvironmentCollectorInterface]]: - return [CustomEnvironmentCollector, DefaultEnvironmentCollector] # type: ignore + return [CustomEnvironmentCollector, DefaultEnvironmentCollector] # type: ignore[list-item] diff --git a/src/hatch/plugin/utils.py b/src/hatch/plugin/utils.py index b2e83da6e..9991ef7ce 100644 --- a/src/hatch/plugin/utils.py +++ b/src/hatch/plugin/utils.py @@ -12,8 +12,8 @@ def load_plugin_from_script( from importlib.util import module_from_spec, spec_from_file_location spec = spec_from_file_location(script_name, path) - module = module_from_spec(spec) # type: ignore - spec.loader.exec_module(module) # type: ignore + module = module_from_spec(spec) # type: ignore[arg-type] + spec.loader.exec_module(module) # type: ignore[union-attr] plugin_finder = f'get_{plugin_id}' names = dir(module) diff --git a/src/hatch/utils/platform.py b/src/hatch/utils/platform.py index 04eca142c..6e7b45183 100644 --- a/src/hatch/utils/platform.py +++ b/src/hatch/utils/platform.py @@ -176,7 +176,7 @@ def populate_default_popen_kwargs(self, kwargs: dict[str, Any], *, shell: bool) @staticmethod def stream_process_output(process: Popen) -> Iterable[str]: # To avoid blocking never use a pipe's file descriptor iterator. See https://bugs.python.org/issue3907 - for line in iter(process.stdout.readline, b''): # type: ignore + for line in iter(process.stdout.readline, b''): # type: ignore[union-attr] yield line.decode('utf-8') @property