diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 322701b..1c6b790 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,7 +47,8 @@ repos: rev: v0.960 hooks: - id: mypy - args: [--no-strict-optional, --ignore-missing-imports] + args: + [--show-error-codes, --no-strict-optional, --ignore-missing-imports] additional_dependencies: [types-pkg_resources, types-requests, types-python-dateutil] - repo: https://github.com/packit/pre-commit-hooks diff --git a/specfile/__init__.py b/specfile/__init__.py index 4e1ac71..e49b4c0 100644 --- a/specfile/__init__.py +++ b/specfile/__init__.py @@ -10,8 +10,8 @@ try: from importlib.metadata import PackageNotFoundError, distribution except ImportError: - from importlib_metadata import PackageNotFoundError # type: ignore - from importlib_metadata import distribution # type: ignore + from importlib_metadata import PackageNotFoundError # type: ignore[no-redef] + from importlib_metadata import distribution # type: ignore[no-redef] try: __version__ = distribution(__name__).version diff --git a/specfile/sources.py b/specfile/sources.py index 217e8d5..ca1d13f 100644 --- a/specfile/sources.py +++ b/specfile/sources.py @@ -17,30 +17,29 @@ class Source(ABC): """Class that represents a source.""" - @property # type: ignore + @property @abstractmethod def number(self) -> int: """Source number.""" ... - @property # type: ignore + @property @abstractmethod def location(self) -> str: """Literal location of the source as stored in the spec file.""" ... - @location.setter # type: ignore - @abstractmethod + @location.setter def location(self, value: str) -> None: ... - @property # type: ignore + @property @abstractmethod def expanded_location(self) -> str: """Location of the source after expanding macros.""" ... - @property # type: ignore + @property @abstractmethod def filename(self) -> str: """Literal filename of the source.""" @@ -52,13 +51,13 @@ def remote(self) -> bool: url = urllib.parse.urlsplit(self.expanded_location) return all((url.scheme, url.netloc)) - @property # type: ignore + @property @abstractmethod def expanded_filename(self) -> str: """Filename of the source after expanding macros.""" ... - @property # type: ignore + @property @abstractmethod def comments(self) -> Comments: """List of comments associated with the source."""