feat(parser): enable setting mather name for defaul regex

ref: #3 #1
This commit is contained in:
2025-07-01 20:00:29 +09:30
parent f53cd10241
commit b18043c2f0

View File

@ -181,12 +181,16 @@ for line in sys.stdin:
if match_matcher_type: if match_matcher_type:
regex_type = match_matcher_type['type'] regex_type = match_matcher_type['type']
if regex_type in regex:
pattern = re.compile( regex[regex_type] ) pattern = re.compile( regex[regex_type] )
match = pattern.finditer(line) match = pattern.finditer(line)
problem_matcher = matcher.search(line,) problem_matcher = matcher.search(line)
if problem_matcher: if problem_matcher:
@ -231,14 +235,13 @@ for tool, tool_results in results.items():
for entry in tool_results: for entry in tool_results:
if tool == 'default': if tool == 'pylint-json':
api_body['comments'] += [ default_matcher( entry ) ]
elif tool == 'pylint-json':
api_body['comments'] += [ pylint_matcher( entry ) ] api_body['comments'] += [ pylint_matcher( entry ) ]
else:
api_body['comments'] += [ default_matcher( entry, tool_name = tool ) ]
if tool not in type_count: if tool not in type_count: