mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
enable pylint in ci
This commit is contained in:
parent
47b451ff9f
commit
1bcf308661
5 changed files with 211 additions and 7 deletions
|
|
@ -185,7 +185,7 @@ def _replace_pattern_parts(pattern: str) -> str:
|
|||
return pattern
|
||||
|
||||
|
||||
def _compile_pattern(pattern: str) -> str:
|
||||
def compile_pattern_str(pattern: str) -> str:
|
||||
for char, escaped in PATTERN_ESCAPES:
|
||||
pattern = pattern.replace(char, escaped)
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ def _compile_pattern(pattern: str) -> str:
|
|||
|
||||
|
||||
def compile_pattern(pattern: str) -> typ.Pattern[str]:
|
||||
pattern_str = _compile_pattern(pattern)
|
||||
pattern_str = compile_pattern_str(pattern)
|
||||
return re.compile(pattern_str)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ def rewrite_lines(
|
|||
if non_matched_patterns:
|
||||
for non_matched_pattern in non_matched_patterns:
|
||||
logger.error(f"No match for pattern '{non_matched_pattern}'")
|
||||
compiled_pattern = patterns._compile_pattern(non_matched_pattern)
|
||||
logger.error(f"Pattern compiles to regex '{compiled_pattern}'")
|
||||
compiled_pattern_str = patterns.compile_pattern_str(non_matched_pattern)
|
||||
logger.error(f"Pattern compiles to regex '{compiled_pattern_str}'")
|
||||
raise NoPatternMatch("Invalid pattern(s)")
|
||||
else:
|
||||
return new_lines
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue