...
 
Commits (3)
......@@ -39,7 +39,7 @@ code_quality_diff:
stage: code_quality_diff
script:
- git fetch -a
- pip install diff-cov-lint==0.1.3
- pip install diff-cov-lint==0.1.4
- pylint --exit-zero diff_cov_lint > pylint_output.txt
- diff-cov-lint origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME origin/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME --cov_report coverage.xml --lint_report pylint_output.txt --show_missing
only:
......
import re
from collections import defaultdict
P_PYLINT_ERROR = re.compile(
r"^(?P<file>.+?):(?P<line>[0-9]+):(?P<column>[0-9]+): (?P<type>[a-z])(?P<errno>\d+): (?P<msg>.+)", re.IGNORECASE)
lint_dict = defaultdict(lambda: defaultdict(dict))
with open("tests/repo/pylint_output.txt") as f:
lines = f.readlines()
for l in lines:
match = re.search(P_PYLINT_ERROR, l)
if match is not None:
groupdict = match.groupdict()
filename = groupdict['file']
line = groupdict['line']
error = groupdict['type'] + groupdict['errno']
msg = groupdict['msg']
lint_dict[filename][line] = {'error': error, 'msg': msg}
print({k: dict(lint_dict[k]) for k in lint_dict})
\ No newline at end of file
fire==0.2.1
gitpython==3.0.5
gitpython==3.0.8
unidiff==0.5.5
\ No newline at end of file
......@@ -17,7 +17,7 @@ requirements = parse_requirements('requirements.txt')
setuptools.setup(
name="diff_cov_lint",
version="0.1.3",
version="0.1.4",
author="Sergey Verentsov",
author_email="[email protected]",
description="Linting and coverage reports for diff only",
......