From 19d58d0f2fd0c2f4ca0ffe66853cba88fe239cc5 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 8 Feb 2022 12:54:26 -0500 Subject: [PATCH 1/2] add custom pylint plugin to pylint checks --- pylintrc | 2 ++ test/azure/version-tolerant/tox.ini | 1 + test/llc/version-tolerant/tox.ini | 1 + test/vanilla/version-tolerant/tox.ini | 1 + 4 files changed, 5 insertions(+) diff --git a/pylintrc b/pylintrc index 94c552dff1d..1bc26a9168a 100644 --- a/pylintrc +++ b/pylintrc @@ -5,6 +5,8 @@ reports=no # PYLINT DIRECTORY BLACKLIST. ignore=_generated,samples,examples,test,tests,doc,.tox +load-plugins=pylint_guidelines_checker + [MESSAGES CONTROL] # For all codes, run 'pylint --list-msgs' or go to 'https://pylint.readthedocs.io/en/latest/reference_guide/features.html' # locally-disabled: Warning locally suppressed using disable-msg diff --git a/test/azure/version-tolerant/tox.ini b/test/azure/version-tolerant/tox.ini index cd2ee8c9ad9..d681f69f88a 100644 --- a/test/azure/version-tolerant/tox.ini +++ b/test/azure/version-tolerant/tox.ini @@ -13,6 +13,7 @@ commands= deps= -rrequirements.txt pylint + git+https://github.com/Azure/azure-sdk-for-python#subdirectory=scripts/pylint_custom_plugin&egg=pylint-guidelines-checker commands = python ../../../eng/scripts/run_pylint.py -t azure -g version-tolerant diff --git a/test/llc/version-tolerant/tox.ini b/test/llc/version-tolerant/tox.ini index be34a2aed13..971da496902 100644 --- a/test/llc/version-tolerant/tox.ini +++ b/test/llc/version-tolerant/tox.ini @@ -6,6 +6,7 @@ skipsdist=True deps= -rrequirements.txt pylint + git+https://github.com/Azure/azure-sdk-for-python#subdirectory=scripts/pylint_custom_plugin&egg=pylint-guidelines-checker commands = python ../../../eng/scripts/run_pylint.py -t llc -g version-tolerant diff --git a/test/vanilla/version-tolerant/tox.ini b/test/vanilla/version-tolerant/tox.ini index 0cd91bb314e..7a146375bff 100644 --- a/test/vanilla/version-tolerant/tox.ini +++ b/test/vanilla/version-tolerant/tox.ini @@ -13,6 +13,7 @@ commands= deps= -rrequirements.txt pylint + git+https://github.com/Azure/azure-sdk-for-python#subdirectory=scripts/pylint_custom_plugin&egg=pylint-guidelines-checker commands = python ../../../eng/scripts/run_pylint.py -t vanilla -g version-tolerant From d7697fb52407c1cb0634b5559ba33669689067b3 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 8 Feb 2022 13:22:59 -0500 Subject: [PATCH 2/2] remove pylint guidelines checker from overall pylintrc, move to generated code calls only --- eng/scripts/run_pylint.py | 1 + pylintrc | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/scripts/run_pylint.py b/eng/scripts/run_pylint.py index ea6c49f55a0..4ad17eeb424 100644 --- a/eng/scripts/run_pylint.py +++ b/eng/scripts/run_pylint.py @@ -30,6 +30,7 @@ def _single_dir_pylint(mod): "-m", "pylint", "--rcfile={}".format(rfc_file_location), + "--load-plugins=pylint_guidelines_checker" "--output-format=parseable", str(inner_class.absolute()), ] diff --git a/pylintrc b/pylintrc index 1bc26a9168a..94c552dff1d 100644 --- a/pylintrc +++ b/pylintrc @@ -5,8 +5,6 @@ reports=no # PYLINT DIRECTORY BLACKLIST. ignore=_generated,samples,examples,test,tests,doc,.tox -load-plugins=pylint_guidelines_checker - [MESSAGES CONTROL] # For all codes, run 'pylint --list-msgs' or go to 'https://pylint.readthedocs.io/en/latest/reference_guide/features.html' # locally-disabled: Warning locally suppressed using disable-msg