Skip to content

Commit

Permalink
Merge pull request #64 from packit/nforro-mypy
Browse files Browse the repository at this point in the history
Ignore only specific mypy errors

Reviewed-by: František Nečas <None>
  • Loading branch information
softwarefactory-project-zuul[bot] authored Jun 14, 2022
2 parents 53ec017 + bdaf244 commit fdce446
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions specfile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 7 additions & 8 deletions specfile/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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."""
Expand Down

0 comments on commit fdce446

Please sign in to comment.