From bd6d60805c7772615776d30bfc5687b8c2d8022e Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Wed, 20 Mar 2024 17:39:27 -0700 Subject: [PATCH] print debugging --- src/black/__init__.py | 3 +++ src/black/files.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/black/__init__.py b/src/black/__init__.py index 6f0e128f56c..107da4d95d1 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -760,13 +760,16 @@ def get_sources( # Compare the logic here to the logic in `gen_python_files`. if is_stdin or path.is_file(): + print("a", path, root) if resolves_outside_root_or_cannot_stat(path, root, report): if verbose: out(f'Skipping invalid source: "{path}"', fg="red") continue + print("e", path, root) root_relative_path = best_effort_relative_path(path, root).as_posix() root_relative_path = "/" + root_relative_path + print("f", root_relative_path) # Hard-exclude any files that matches the `--force-exclude` regex. if path_is_excluded(root_relative_path, force_exclude): diff --git a/src/black/files.py b/src/black/files.py index c0cadbfd890..b04f87a1b33 100644 --- a/src/black/files.py +++ b/src/black/files.py @@ -268,6 +268,7 @@ def resolves_outside_root_or_cannot_stat( Returns whether the path is a symbolic link that points outside the root directory. Also returns True if we failed to resolve the path. """ + print("b", path, root) try: if sys.version_info < (3, 8, 6): path = path.absolute() # https://bugs.python.org/issue33660 @@ -276,12 +277,14 @@ def resolves_outside_root_or_cannot_stat( if report: report.path_ignored(path, f"cannot be read because {e}") return True + print("c", resolved_path, root) try: resolved_path.relative_to(root) except ValueError: if report: report.path_ignored(path, f"is a symbolic link that points outside {root}") return True + print("d") return False