From 5ed3e5edba9161d19d234dbc7a1bf63de878dcbf Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 22 Nov 2017 15:07:28 -0500 Subject: [PATCH] Make run_quality use the same upper pylint limit as run_pylint --- pavelib/quality.py | 11 +++++++---- scripts/generic-ci-tests.sh | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pavelib/quality.py b/pavelib/quality.py index 58c00b3811..1f03e17374 100644 --- a/pavelib/quality.py +++ b/pavelib/quality.py @@ -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 or :"), ]) @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 ----- diff --git a/scripts/generic-ci-tests.sh b/scripts/generic-ci-tests.sh index dd310feecc..9d0a568c85 100755 --- a/scripts/generic-ci-tests.sh +++ b/scripts/generic-ci-tests.sh @@ -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.