diff options
| author | grothedev <grothedev@gmail.com> | 2025-08-24 13:09:56 -0400 |
|---|---|---|
| committer | grothedev <grothedev@gmail.com> | 2025-08-24 13:09:56 -0400 |
| commit | 327fd1c0ff47b8ef3bc68ba976e36af813811eb1 (patch) | |
| tree | 780aad8440ee317af82f8feed4dca142c53cf92f | |
| parent | 2b59e384f973005a5e7eb16f87ea96a5b93777a3 (diff) | |
default exclude pattern
| -rwxr-xr-x | wow3.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -19,7 +19,7 @@ paths=[] #the paths to scan recursively for files from which to grab text matchpattern='' #if we want to filter the files by some text pattern that the filename must match time_min = -1 #threshold time. dont use files that are older v=False -exclude_dirs = ['.git', 'node_modules', 'vendor'] +exclude_patterns_default = ['.git', 'node_modules', 'vendor', '\.~lock'] #default patterns to exclude def attemptReadSampleFile(filepath): if v: print('checking {}'.format(filepath)) @@ -59,10 +59,10 @@ def getSampleFiles(paths, exclude_patterns = []): # Compile exclusion patterns into a single regex for efficiency compiled_exclusions = None - if exclude_patterns: - # Join patterns with OR operator and compile once - pattern = '|'.join(f'({pattern})' for pattern in exclude_patterns) - compiled_exclusions = re.compile(pattern, re.IGNORECASE) + exclude_patterns = exclude_patterns + exclude_patterns_default + # Join patterns with OR operator and compile once + pattern = '|'.join(f'({pattern})' for pattern in exclude_patterns) + compiled_exclusions = re.compile(pattern, re.IGNORECASE) tStart = time.time() for p in paths: @@ -160,4 +160,4 @@ def main(): if __name__ == '__main__': - main()
\ No newline at end of file + main() |
