Add test run option to PFERD

This commit is contained in:
Joscha
2020-04-24 18:00:21 +00:00
parent 5b929f09a2
commit 8258fa8919
2 changed files with 25 additions and 4 deletions

View File

@@ -59,6 +59,8 @@ def _pattern(regex: Regex) -> re.Pattern:
# Transform combinators
keep = lambda path: path
def attempt(*args: Transform) -> Transform:
def inner(path: PurePath) -> Optional[PurePath]:
for transform in args:
@@ -134,6 +136,7 @@ def re_rename(regex: Regex, target: str) -> Transform:
return None
return inner
# def match(regex: Union[str, re.Pattern]) -> Transform:
# pattern: re.Pattern
# if isinstance(regex, str):