Skip to content

Commit e32c8db

Browse files
committed
refactor: clean up folder exclusion terminology
- Remove 'patch' references from function names and comments - Rename apply_folder_exclusion_patches() to _configure_folder_exclusion() - Rename patched_skip() to enhanced_skip() - Rename patched_get_files() to enhanced_get_files() - Update comments to reflect natural functionality rather than retrofitted patches
1 parent 96090e9 commit e32c8db

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

.tools/readmes/runner.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,42 @@
1919
from collections import defaultdict
2020
import re
2121

22-
# Folders to exclude from processing (can be extended as needed)
22+
# Folders to exclude from processing
2323
EXCLUDED_FOLDERS = {'.kiro', '.git', 'node_modules', '__pycache__'}
2424

2525

26-
def apply_folder_exclusion_patches():
27-
"""
28-
Apply patches to exclude specified folders from processing.
29-
This integrates folder exclusion as a core feature.
30-
"""
26+
def _configure_folder_exclusion():
27+
"""Configure file processing to exclude specified folders."""
3128
from aws_doc_sdk_examples_tools import file_utils, validator_config
3229
from aws_doc_sdk_examples_tools.fs import Fs, PathFs
3330

34-
def patched_skip(path: Path) -> bool:
35-
"""Enhanced skip function that ignores specified folders."""
31+
def enhanced_skip(path: Path) -> bool:
32+
"""Skip function that ignores excluded folders and standard ignored files."""
3633
# Check if path contains any excluded folders
3734
if any(excluded_folder in path.parts for excluded_folder in EXCLUDED_FOLDERS):
3835
return True
3936

40-
# Call original skip logic
37+
# Apply standard skip logic
4138
return path.suffix.lower() not in validator_config.EXT_LOOKUP or path.name in validator_config.IGNORE_FILES
4239

43-
def patched_get_files(
40+
def enhanced_get_files(
4441
root: Path, skip: Callable[[Path], bool] = lambda _: False, fs: Fs = PathFs()
4542
) -> Generator[Path, None, None]:
46-
"""Enhanced get_files that uses our patched skip function."""
43+
"""Get files using enhanced skip function."""
4744
for path in file_utils.walk_with_gitignore(root, fs=fs):
48-
if not patched_skip(path):
45+
if not enhanced_skip(path):
4946
yield path
5047

51-
# Apply the patches
52-
validator_config.skip = patched_skip
53-
file_utils.get_files = patched_get_files
48+
# Configure the file processing functions
49+
validator_config.skip = enhanced_skip
50+
file_utils.get_files = enhanced_get_files
5451

5552
excluded_list = ', '.join(sorted(EXCLUDED_FOLDERS))
56-
print(f"Applied folder exclusion: {excluded_list} folders excluded")
53+
print(f"Folder exclusion configured: {excluded_list} folders excluded")
5754

5855

59-
# Apply folder exclusion patches when module is imported
60-
apply_folder_exclusion_patches()
56+
# Configure folder exclusion when module is imported
57+
_configure_folder_exclusion()
6158

6259

6360
# Default to not using Rich

0 commit comments

Comments
 (0)