From 03d4cfc7f71c135d819f15f2055c385679ea6d31 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Fri, 13 Dec 2024 16:43:15 +0100 Subject: [PATCH] Extend checks to folder names --- .github/workflows/validate.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 65b4339550..cdf0771e83 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -77,7 +77,7 @@ jobs: exit 1 fi - - name: Check file names + - name: Check file and folder names in content shell: python {0} continue-on-error: true run: | @@ -93,15 +93,17 @@ jobs: for root, dirs, files in os.walk(content_dir): for file in files: full_path = Path(root, file) - if full_path.suffix.lower() != '.md': - continue if full_path.name == '_index.md': continue if not allowed_chars.match(full_path.stem): errors.append(f"- {full_path}'\n") + + for dir in dirs: + if not allowed_chars.match(dir): + errors.append(f"- {Path(root, dir)}'\n") if len(errors) > 0: - print("The following file names use invalid characters. Only lowercase letters, digits, hyphens and period are allowed.\n\n") + print("The following file/folder names use invalid characters. Only lowercase letters, digits, hyphens and period are allowed.\n\n") for error in errors: print(error) sys.exit(1)