From a30981ad393e1cc48ed5e8743ad7158ee50a1c97 Mon Sep 17 00:00:00 2001 From: Stanislav Pankevich Date: Thu, 21 Dec 2023 23:10:00 +0100 Subject: [PATCH] file_tree: improve file finding filter Use a primitive filter for now. Switch to .gitignore-based filter soon. Related to: #1511 --- strictdoc/core/file_tree.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/strictdoc/core/file_tree.py b/strictdoc/core/file_tree.py index ba95c0476..8225a42ba 100644 --- a/strictdoc/core/file_tree.py +++ b/strictdoc/core/file_tree.py @@ -176,7 +176,14 @@ def find_files_with_extensions( dirs[:] = [ d for d in dirs - if (not d.startswith(".") and not d.startswith("_")) + if ( + not d.startswith(".") + and not d.startswith("_") + and d != "build" + and d != "output" + and d != "Output" + and d != "tests" + ) ] dirs.sort(key=alphanumeric_sort) @@ -259,6 +266,8 @@ def find_directories(root_path, directory): d for d in dirs if not d.startswith(".") + and not d.startswith("__") + and d != "build" and d != "output" and d != "Output" and d != "tests"