Docstrings arguments cleanup (#3229)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-06-17 16:17:07 +02:00 committed by GitHub
parent 62916b3b0a
commit bd0f7ecf6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
93 changed files with 1104 additions and 1102 deletions

View file

@ -422,7 +422,7 @@ def is_dir_writeable(dir_path: Union[str, Path]) -> bool:
Check if a directory is writeable.
Args:
dir_path (str) or (Path): The path to the directory.
dir_path (str | Path): The path to the directory.
Returns:
(bool): True if the directory is writeable, False otherwise.
@ -467,7 +467,7 @@ def get_git_dir():
If the current file is not part of a git repository, returns None.
Returns:
(Path) or (None): Git root directory if found or None if not found.
(Path | None): Git root directory if found or None if not found.
"""
for d in Path(__file__).parents:
if (d / '.git').is_dir():
@ -480,7 +480,7 @@ def get_git_origin_url():
Retrieves the origin URL of a git repository.
Returns:
(str) or (None): The origin URL of the git repository.
(str | None): The origin URL of the git repository.
"""
if is_git_dir():
with contextlib.suppress(subprocess.CalledProcessError):
@ -494,7 +494,7 @@ def get_git_branch():
Returns the current git branch name. If not in a git repository, returns None.
Returns:
(str) or (None): The current git branch name.
(str | None): The current git branch name.
"""
if is_git_dir():
with contextlib.suppress(subprocess.CalledProcessError):