From 47b4272d5ac4afa46b1384d3bcda93db63c8c920 Mon Sep 17 00:00:00 2001 From: Lucas Biaggi Date: Thu, 25 Apr 2024 09:26:42 +0100 Subject: [PATCH] Allow hidden paths to be referenced Using other git repo tools, such as GitLab, have different practices about how to organize CI config files, even GitHub has hidden paths practices, so ignoring a reference inside one of these folder is important, and shouldn't be ignored. --- doorstop/core/vcs/base.py | 4 ++-- doorstop/settings.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doorstop/core/vcs/base.py b/doorstop/core/vcs/base.py index ed553bfdc..5f96dd8af 100644 --- a/doorstop/core/vcs/base.py +++ b/doorstop/core/vcs/base.py @@ -94,8 +94,8 @@ def paths(self): # Skip ignored paths if self.ignored(relpath): continue - # Skip hidden paths - if os.path.sep + "." in os.path.sep + relpath: + # Skip hidden paths according to settings definition + if not settings.ALLOW_HIDDEN_PATH_REFERENCES: continue self._path_cache.append((path, filename, relpath)) yield from self._path_cache diff --git a/doorstop/settings.py b/doorstop/settings.py index 264ef02cb..3eed0dd53 100644 --- a/doorstop/settings.py +++ b/doorstop/settings.py @@ -24,6 +24,9 @@ PLACEHOLDER = "..." # placeholder for new item UIDs on export/import PLACEHOLDER_COUNT = 1 # number of placeholders to include on export +# VCS Behaviour +ALLOW_HIDDEN_PATH_REFERENCES=False + # Formatting settings MAX_LINE_LENGTH = 79 # line length to trigger multiline on extended attributes