Add file ignore functionality and update documentation for ignore patterns

This commit is contained in:
mrT23
2024-06-13 12:27:10 +03:00
parent aa56c0097d
commit 58bc54b193
3 changed files with 19 additions and 1 deletions

View File

@ -38,6 +38,9 @@ def filter_ignored(files):
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']))]
elif isinstance(files[0], str): # azure devops
for r in compiled_patterns:
files = [f for f in files if not r.match(f)]
except Exception as e:
print(f"Could not filter file list: {e}")

View File

@ -15,7 +15,7 @@ def filter_bad_extensions(files):
return [f for f in files if f.filename is not None and is_valid_file(f.filename)]
def is_valid_file(filename):
def is_valid_file(filename: str):
return filename.split('.')[-1] not in bad_extensions