Skip to content

Commit

Permalink
Document the new return value in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivansh-007 committed Nov 2, 2021
1 parent 7a5bac6 commit 44cfd6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,13 @@ def get_sources(
report: "Report",
stdin_filename: Optional[str],
) -> Tuple[Set[Path], Path]:
"""Compute the set of files to be formatted."""
"""
Compute the set of files to be formatted.
Returns a tuple, with the first element as a set of paths which are to be
checked/formatted by black, and the second element as the project root
found out by black.
"""
root, method = find_project_root(src)

if verbose:
Expand Down
5 changes: 5 additions & 0 deletions src/black/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def find_project_root(srcs: Sequence[str]) -> Tuple[Path, Optional[str]]:
If no directory in the tree contains a marker that would specify it's the
project root, the root of the file system is returned.
Returns a tuple with the first element as the project root path and the
second element as a string which describes the method by which black
found out the project root (None, if `None` of the registered method
was used).
"""
if not srcs:
srcs = [str(Path.cwd().resolve())]
Expand Down

0 comments on commit 44cfd6c

Please sign in to comment.