feat: adds option to pass file regex pattern#30
Merged
Conversation
helen-m-lin
approved these changes
Sep 23, 2025
galenlynch
requested changes
Sep 23, 2025
Collaborator
galenlynch
left a comment
There was a problem hiding this comment.
You probably want re.search not re.match.
| Keys are Paths and values are argument sets. Default is an empty | ||
| dictionary. | ||
| file_filter_pattern : str | None | ||
| If set, will filter file names based on this pattern. Default is None. |
Collaborator
There was a problem hiding this comment.
Suggested change
| If set, will filter file names based on this pattern. Default is None. | |
| If set, will filter file names based on this regex pattern. Default is None. |
| ffmpeg_thread_cnt: int = Field( | ||
| default=0, description="Number of threads per ffmpeg compression job." | ||
| ) | ||
| file_filter: Optional[str] = Field( |
Collaborator
There was a problem hiding this comment.
Suggested change
| file_filter: Optional[str] = Field( | |
| file_filter: str | None = Field( |
ruff UP007
| from os import symlink, walk | ||
| from os.path import relpath | ||
| from pathlib import Path | ||
| from typing import Optional |
Collaborator
There was a problem hiding this comment.
Suggested change
| from typing import Optional |
Not needed if you follow str | None
| output_dir: Path, | ||
| arg_set, | ||
| overrides=dict(), | ||
| file_filter_pattern: Optional[str] = None, |
Collaborator
There was a problem hiding this comment.
Suggested change
| file_filter_pattern: Optional[str] = None, | |
| file_filter_pattern: str | None = None, |
UP007
|
|
||
| for file_name in files: | ||
| file_path = Path(root) / file_name | ||
| if file_filter_pattern and not re.match( |
Collaborator
There was a problem hiding this comment.
Suggested change
| if file_filter_pattern and not re.match( | |
| if file_filter_pattern and not re.search( |
re.match only matches at the beginning of the string, which I imagine was not the intent. re.search matches anywhere in the string. If it was the intent, clarify that in the documentation for this field, since it would be surprising to me.
galenlynch
approved these changes
Sep 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #29
setuptools-scmfrom build-system, which has been causing issues in github actions workflows