Merge pull request #676 from oraios/minor_fix_in_ignored_path

Minor fix in ignored path
This commit is contained in:
Michael Panchenko authored and GitHub committed 2025-10-16 18:34:44 +02:00
commit 5dfb8ad912
1 file changed
+6
+6
View File
@@ -105,6 +105,12 @@ class Project:
:return: whether the path should be ignored
"""
# special case, never ignore the project root itself
# If the user ignores hidden files, "." might match against the corresponding PathSpec pattern.
# The empty string also points to the project root and should never be ignored.
if str(relative_path) in [".", ""]:
return False
abs_path = os.path.join(self.project_root, relative_path)
if not os.path.exists(abs_path):
raise FileNotFoundError(f"File {abs_path} not found, the ignore check cannot be performed")