mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
Add file ignore functionality and update documentation for ignore patterns
This commit is contained in:
@ -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}")
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user