From 61c3411faf89fff4dd15f05f8afbfe1c73546fdd Mon Sep 17 00:00:00 2001 From: theonepath Date: Thu, 12 May 2022 14:01:06 +0100 Subject: [PATCH] Updated utils/common.py Fixed bug with regex to allow for pathspecs containing a period (.) character, and amended statement to flake8 W504 definition. --- clog/utils/common.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clog/utils/common.py b/clog/utils/common.py index 862b842..062b220 100644 --- a/clog/utils/common.py +++ b/clog/utils/common.py @@ -48,6 +48,5 @@ def is_path_spec(path_spec: str) -> bool: """ ## perform a regex match to ensure that the given path is a ## valid pathspec for the system. - return bool(re.match( - __REGEX_PAT, path_spec.strip(r"\"'")) or re.match(r'^[\w\d\-_]+$', path_spec.strip(r"\"'")) - ) \ No newline at end of file + return bool(re.match(__REGEX_PAT, path_spec.strip(r"\"'")) + or re.match(r'^[\w\d\-_\.]+$', path_spec.strip(r"\"'"))) \ No newline at end of file