mirror of
https://github.com/zensical/zensical.git
synced 2026-05-04 01:50:48 +00:00
fix: don't watch mkdocstrings-configured path if it's the root directory
This is a follow-up of commit 6e3d5ef64b which was actually incomplete. Since a/ is relative to a/, we also have to check that a path configured through mkdocstrings-python's option isn't the project root itself.
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
committed by
GitHub
parent
b3c699ba45
commit
e33c972e03
@@ -501,7 +501,7 @@ def _list_sources(config: dict, config_file: str) -> list[tuple[str, int]]:
|
||||
root = Path(config_file).parent.resolve()
|
||||
for python_path in python_paths:
|
||||
path = root.joinpath(python_path).resolve()
|
||||
if path.is_dir() and path.is_relative_to(root):
|
||||
if path.is_dir() and path.is_relative_to(root) and path != root:
|
||||
for subpath in path.rglob("*"):
|
||||
# Path.rglob can't do patterns, so we need to filter here
|
||||
if subpath.suffix in {
|
||||
|
||||
Reference in New Issue
Block a user