]>
git.madduck.net Git - etc/vim.git/blobdiff - src/black/files.py
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
import colorama # noqa: F401
import colorama # noqa: F401
def find_project_root(
srcs: Sequence[str], stdin_filename: Optional[str] = None
) -> Tuple[Path, str]:
def find_project_root(
srcs: Sequence[str], stdin_filename: Optional[str] = None
) -> Tuple[Path, str]:
return directory, "file system root"
return directory, "file system root"
-def find_pyproject_toml(path_search_start: Tuple[str, ...]) -> Optional[str]:
+def find_pyproject_toml(
+ path_search_start: Tuple[str, ...], stdin_filename: Optional[str] = None
+) -> Optional[str]:
"""Find the absolute filepath to a pyproject.toml if it exists"""
"""Find the absolute filepath to a pyproject.toml if it exists"""
- path_project_root, _ = find_project_root(path_search_start)
+ path_project_root, _ = find_project_root(path_search_start, stdin_filename )
path_pyproject_toml = path_project_root / "pyproject.toml"
if path_pyproject_toml.is_file():
return str(path_pyproject_toml)
path_pyproject_toml = path_project_root / "pyproject.toml"
if path_pyproject_toml.is_file():
return str(path_pyproject_toml)
return SpecifierSet(",".join(str(s) for s in specifiers))
return SpecifierSet(",".join(str(s) for s in specifiers))
def find_user_pyproject_toml() -> Path:
r"""Return the path to the top-level user configuration for black.
def find_user_pyproject_toml() -> Path:
r"""Return the path to the top-level user configuration for black.
return user_config_path.resolve()
return user_config_path.resolve()
def get_gitignore(root: Path) -> PathSpec:
"""Return a PathSpec matching gitignore content if present."""
gitignore = root / ".gitignore"
def get_gitignore(root: Path) -> PathSpec:
"""Return a PathSpec matching gitignore content if present."""
gitignore = root / ".gitignore"