diff options
author | yobmod <yobmod@gmail.com> | 2021-05-08 16:37:23 +0100 |
---|---|---|
committer | yobmod <yobmod@gmail.com> | 2021-05-08 16:37:23 +0100 |
commit | 6a2f5d05f4a8e3427d6dd2a5981f148a9f6bef84 (patch) | |
tree | c90a0b010464fdf025d58328d2679c6ebf01c104 | |
parent | 96f8f17d5d63c0e0c044ac3f56e94a1aa2e45ec3 (diff) | |
download | gitpython-6a2f5d05f4a8e3427d6dd2a5981f148a9f6bef84.tar.gz |
Add types to Remote. init getattr exists
-rw-r--r-- | git/remote.py | 6 | ||||
-rw-r--r-- | mypy.ini | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/git/remote.py b/git/remote.py index 2eeafcc4..a6c76e19 100644 --- a/git/remote.py +++ b/git/remote.py @@ -433,7 +433,7 @@ class Remote(LazyMixin, Iterable): __slots__ = ("repo", "name", "_config_reader") _id_attribute_ = "name" - def __init__(self, repo, name): + def __init__(self, repo: 'Repo', name: str) -> None: """Initialize a remote instance :param repo: The repository we are a remote of @@ -441,7 +441,7 @@ class Remote(LazyMixin, Iterable): self.repo = repo # type: 'Repo' self.name = name - def __getattr__(self, attr): + def __getattr__(self, attr: str) -> Any: """Allows to call this instance like remote.special( \\*args, \\*\\*kwargs) to call git-remote special self.name""" if attr == "_config_reader": @@ -481,7 +481,7 @@ class Remote(LazyMixin, Iterable): def __hash__(self): return hash(self.name) - def exists(self): + def exists(self) -> bool: """ :return: True if this is a valid, existing remote. Valid remotes have an entry in the repository's configuration""" @@ -2,7 +2,7 @@ [mypy] # TODO: enable when we've fully annotated everything -#disallow_untyped_defs = True +disallow_untyped_defs = True # TODO: remove when 'gitdb' is fully annotated [mypy-gitdb.*] |