Add file ignore functionality and update documentation for ignore patterns

This commit is contained in:
mrT23
2024-06-13 12:09:52 +03:00
parent 2076454798
commit 20f6af803c
3 changed files with 49 additions and 41 deletions

View File

@ -28,11 +28,11 @@ def filter_ignored(files):
pass
# keep filenames that _don't_ match the ignore regex
if files:
if files and isinstance(files, list):
if hasattr(files[0], 'filename'): # github
for r in compiled_patterns:
files = [f for f in files if (f.filename and not r.match(f.filename))]
elif 'new_path' in files[0]: # gitlab
elif isinstance(files[0], dict) and 'new_path' in files[0]: # gitlab
for r in compiled_patterns:
files = [f for f in files if (f['new_path'] and not r.match(f['new_path']))]