Skip to content

Commit 41fef79

Browse files
authored
Merge pull request #2191 from tisnik/lcore-3141-ability-to-disable-some-directories
LCORE-3141: Ability to disable some directories
2 parents 4b81de9 + 4ff1220 commit 41fef79

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

scripts/gen_doc.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@
88

99
DIRECTORIES = ["src", "tests/unit", "tests/integration", "tests/e2e"]
1010

11+
# README.md files won't be generated in following directories
12+
DIRS_TO_SKIP = {
13+
"tests/integration",
14+
"tests/e2e",
15+
"tests/e2e/configuration",
16+
"tests/e2e/rag",
17+
"tests/e2e/secrets",
18+
"tests/e2e/skills",
19+
"tests/e2e/skills/echo",
20+
"tests/e2e/skills/echo/references",
21+
"tests/e2e/skills/summarize",
22+
"tests/e2e/skills/summarize/references",
23+
}
24+
1125

1226
def generate_docfile(directory: Path) -> None:
1327
"""
@@ -47,17 +61,25 @@ def generate_documentation_on_path(path: Path) -> None:
4761
4862
This function generate README.md for Python sources in the given directory.
4963
64+
Directory can be skipped if it's part of DIRS_TO_SKIP global list.
65+
5066
Parameters:
5167
----------
5268
path (str or os.PathLike): Directory in which to generate the README.md file.
5369
"""
5470
directory = path
71+
72+
# directory can be skipped if it's part of DIRS_TO_SKIP global list.
73+
if path.as_posix() in DIRS_TO_SKIP:
74+
print(f"[gendoc] Skipping {path}")
75+
return
76+
5577
cwd = os.getcwd()
56-
os.chdir(directory)
57-
print(f"[gendoc] Generating README.md in: {directory}")
78+
os.chdir(path)
5879

5980
try:
60-
generate_docfile(directory)
81+
print(f"[gendoc] Generating README.md in: {path}")
82+
generate_docfile(path)
6183
finally:
6284
os.chdir(cwd)
6385

0 commit comments

Comments
 (0)