From 43305237c0ff026f6c4a6567be53286ad076d23f Mon Sep 17 00:00:00 2001 From: David Tippett <17506770+dtaivpp@users.noreply.github.com> Date: Wed, 30 Jun 2021 15:09:42 -0400 Subject: [PATCH] fixing string parsing on regex --- commit_msg_regex_hook/commit_msg_regex_hook.py | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commit_msg_regex_hook/commit_msg_regex_hook.py b/commit_msg_regex_hook/commit_msg_regex_hook.py index 303081d..3db3898 100644 --- a/commit_msg_regex_hook/commit_msg_regex_hook.py +++ b/commit_msg_regex_hook/commit_msg_regex_hook.py @@ -83,7 +83,7 @@ def process_pattern(pattern_str: str) -> Pattern: """ try: print(f"Incoming Pattern: {pattern_str}") - pattern = re.compile(pattern_str) + pattern = re.compile(pattern_str[1:-1]) except Exception as e: raise argparse.ArgumentTypeError( f"'{pattern_str}' is not a valid regex pattern\n {e}" diff --git a/setup.cfg b/setup.cfg index 31e4752..ce7bbbe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = commit-msg-regex-hook -version = v0.0.7 +version = v0.0.8 author = David Tippett description = Checks if commit message matches supplied regex long_description = file: README.md