Make run_quality use the same upper pylint limit as run_pylint
This commit is contained in:
@@ -685,6 +685,7 @@ def _get_xsscommitlint_count(filename):
|
||||
@cmdopts([
|
||||
("compare-branch=", "b", "Branch to compare against, defaults to origin/master"),
|
||||
("percentage=", "p", "fail if diff-quality is below this percentage"),
|
||||
("limit=", "l", "Limits for number of acceptable violations - either <upper> or <lower>:<upper>"),
|
||||
])
|
||||
@timed
|
||||
def run_quality(options):
|
||||
@@ -730,7 +731,7 @@ def run_quality(options):
|
||||
|
||||
lines.extend([sep, title, sep, violations_str, sep, violations_count_str])
|
||||
|
||||
if count > limit:
|
||||
if count > limit > -1:
|
||||
lines.append(fail_line)
|
||||
lines.append(sep + '\n')
|
||||
if is_html:
|
||||
@@ -757,14 +758,16 @@ def run_quality(options):
|
||||
|
||||
(count, violations_list) = _get_pylint_violations(clean=False)
|
||||
|
||||
_, upper_violations_limit, _, _ = _parse_pylint_options(options)
|
||||
|
||||
# Print number of violations to log
|
||||
print _lint_output('pylint', count, violations_list, limit=6100)
|
||||
print _lint_output('pylint', count, violations_list, limit=upper_violations_limit)
|
||||
|
||||
# Also write the number of violations to a file
|
||||
with open(dquality_dir / "diff_quality_pylint.html", "w") as f:
|
||||
f.write(_lint_output('pylint', count, violations_list, is_html=True, limit=6100))
|
||||
f.write(_lint_output('pylint', count, violations_list, is_html=True, limit=upper_violations_limit))
|
||||
|
||||
if count > 6100:
|
||||
if count > upper_violations_limit > -1:
|
||||
diff_quality_percentage_pass = False
|
||||
|
||||
# ----- Set up for diff-quality pylint call -----
|
||||
|
||||
@@ -116,7 +116,7 @@ case "$TEST_SUITE" in
|
||||
run_paver_quality run_xsscommitlint || EXIT=1
|
||||
# Run quality task. Pass in the 'fail-under' percentage to diff-quality
|
||||
echo "Running diff quality."
|
||||
run_paver_quality run_quality -p 100 || EXIT=1
|
||||
run_paver_quality run_quality -p 100 -l $LOWER_PYLINT_THRESHOLD:$UPPER_PYLINT_THRESHOLD || EXIT=1
|
||||
|
||||
# Need to create an empty test result so the post-build
|
||||
# action doesn't fail the build.
|
||||
|
||||
Reference in New Issue
Block a user