Updated utils/common.py
Fixed bug with regex to allow for pathspecs containing a period (.) character, and amended statement to flake8 W504 definition.
This commit is contained in:
parent
e4446c90ec
commit
61c3411faf
|
|
@ -48,6 +48,5 @@ def is_path_spec(path_spec: str) -> bool:
|
||||||
"""
|
"""
|
||||||
## perform a regex match to ensure that the given path is a
|
## perform a regex match to ensure that the given path is a
|
||||||
## valid pathspec for the system.
|
## valid pathspec for the system.
|
||||||
return bool(re.match(
|
return bool(re.match(__REGEX_PAT, path_spec.strip(r"\"'"))
|
||||||
__REGEX_PAT, path_spec.strip(r"\"'")) or re.match(r'^[\w\d\-_]+$', path_spec.strip(r"\"'"))
|
or re.match(r'^[\w\d\-_\.]+$', path_spec.strip(r"\"'")))
|
||||||
)
|
|
||||||
Loading…
Reference in New Issue
Block a user