More docstring revisions within git.refs · gitpython-developers/GitPython@254c82a · GitHub
Skip to content

Commit 254c82a

Browse files
committed
More docstring revisions within git.refs
1 parent 4b04d8a commit 254c82a

5 files changed

Lines changed: 47 additions & 46 deletions

File tree

git/refs/head.py

Lines changed: 16 additions & 16 deletions

git/refs/log.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ def new(
104104
tz_offset: int,
105105
message: str,
106106
) -> "RefLogEntry": # skipcq: PYL-W0621
107-
""":return: New instance of a RefLogEntry"""
107+
""":return: New instance of a :class:`RefLogEntry`"""
108108
if not isinstance(actor, Actor):
109109
raise ValueError("Need actor instance, got %s" % actor)
110110
# END check types
111111
return RefLogEntry((oldhexsha, newhexsha, actor, (time, tz_offset), message))
112112

113113
@classmethod
114114
def from_line(cls, line: bytes) -> "RefLogEntry":
115-
""":return: New RefLogEntry instance from the given revlog line.
115+
""":return: New :class:`RefLogEntry` instance from the given revlog line.
116116
117117
:param line:
118118
Line bytes without trailing newline
@@ -311,7 +311,7 @@ def append_entry(
311311
:param config_reader:
312312
Configuration reader of the repository - used to obtain user information.
313313
May also be an :class:`~git.util.Actor` instance identifying the committer
314-
directly or None.
314+
directly or ``None``.
315315
316316
:param filepath:
317317
Full path to the log file.
@@ -326,7 +326,7 @@ def append_entry(
326326
Message describing the change to the reference.
327327
328328
:param write:
329-
If True, the changes will be written right away.
329+
If ``True``, the changes will be written right away.
330330
Otherwise the change will not be written.
331331
332332
:return:

git/refs/reference.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __init__(self, repo: "Repo", path: PathLike, check_path: bool = True) -> Non
6565
e.g. ``refs/heads/master``.
6666
6767
:param check_path:
68-
If False, you can provide any path.
68+
If ``False``, you can provide any path.
6969
Otherwise the path must start with the default path prefix of this type.
7070
"""
7171
if check_path and not str(path).startswith(self._common_path_default + "/"):
@@ -141,8 +141,9 @@ def iter_items(
141141
*args: Any,
142142
**kwargs: Any,
143143
) -> Iterator[T_References]:
144-
"""Equivalent to SymbolicReference.iter_items, but will return non-detached
145-
references as well."""
144+
"""Equivalent to
145+
:meth:`SymbolicReference.iter_items <git.refs.symbolic.SymbolicReference.iter_items>`,
146+
but will return non-detached references as well."""
146147
return cls._iter_items(repo, common_path)
147148

148149
# }END interface

git/refs/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def delete(cls, repo: "Repo", *refs: "RemoteReference", **kwargs: Any) -> None:
5656
"""Delete the given remote references.
5757
5858
:note:
59-
kwargs are given for comparability with the base class method as we
59+
`kwargs` are given for comparability with the base class method as we
6060
should not narrow the signature.
6161
"""
6262
repo.git.branch("-d", "-r", *refs)

git/refs/symbolic.py

Lines changed: 22 additions & 22 deletions

0 commit comments

Comments
 (0)