enable pylint in ci

This commit is contained in:
Manuel Barkhau 2020-07-19 19:07:30 +00:00
parent 47b451ff9f
commit 1bcf308661
5 changed files with 211 additions and 7 deletions

View file

@ -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)

View file

@ -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