diff options
-rw-r--r-- | git/refs/symbolic.py | 12 | ||||
-rw-r--r-- | pyproject.toml | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index 80b4fef6..74bc0a39 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -36,9 +36,9 @@ T_References = TypeVar('T_References', bound='SymbolicReference') __all__ = ["SymbolicReference"] -def _git_dir(repo, path): +def _git_dir(repo: 'Repo', path: PathLike) -> PathLike: """ Find the git dir that's appropriate for the path""" - name = "%s" % (path,) + name = f"{path}" if name in ['HEAD', 'ORIG_HEAD', 'FETCH_HEAD', 'index', 'logs']: return repo.git_dir return repo.common_dir @@ -65,18 +65,18 @@ class SymbolicReference(object): def __str__(self) -> str: return str(self.path) - def __repr__(self): + def __repr__(self) -> str: return '<git.%s "%s">' % (self.__class__.__name__, self.path) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: if hasattr(other, 'path'): return self.path == other.path return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: return not (self == other) - def __hash__(self): + def __hash__(self) -> int: return hash(self.path) @property diff --git a/pyproject.toml b/pyproject.toml index 94f74793..6437a719 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ filterwarnings = 'ignore::DeprecationWarning' # filterwarnings ignore::WarningType # ignores those warnings [tool.mypy] -# disallow_untyped_defs = True +# disallow_untyped_defs = true no_implicit_optional = true warn_redundant_casts = true # warn_unused_ignores = True |