From ac7c6738417cbd23118fda97460e30afe9b79abd Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 6 Feb 2023 11:21:13 +0800 Subject: [PATCH 01/26] Update --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e7bb18394..8e97798a8 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ 'gitpython', 'jinja2', 'knack', - 'pylint==2.11.1', + 'pylint==2.16.1', 'pytest-xdist', # depends on pytest-forked 'pytest-forked', 'pytest>=5.0.0', From 44c36eed17607cd8bfc99458a9c99e185b12055d Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 6 Feb 2023 14:03:09 +0800 Subject: [PATCH 02/26] Minor fix --- azdev/operations/help/refdoc/common/directives.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azdev/operations/help/refdoc/common/directives.py b/azdev/operations/help/refdoc/common/directives.py index 92d4e2fc6..0eb0b1faf 100644 --- a/azdev/operations/help/refdoc/common/directives.py +++ b/azdev/operations/help/refdoc/common/directives.py @@ -53,7 +53,7 @@ class CliGroupDirective(CliBaseDirective): Field('docsource', label='Doc Source', has_arg=False, names=('docsource', 'documentsource')), Field('deprecated', label='Deprecated', has_arg=False, - names=('deprecated')) + names=('deprecated',)) ]) @@ -63,7 +63,7 @@ class CliCommandDirective(CliBaseDirective): Field('docsource', label='Doc Source', has_arg=False, names=('docsource', 'documentsource')), Field('deprecated', label='Deprecated', has_arg=False, - names=('deprecated')) + names=('deprecated',)) ]) @@ -71,15 +71,15 @@ class CliArgumentDirective(CliBaseDirective): doc_field_types = copy.copy(_CLI_FIELD_TYPES) doc_field_types.extend([ Field('required', label='Required', has_arg=False, - names=('required')), + names=('required',)), Field('values', label='Allowed values', has_arg=False, names=('values', 'choices', 'options')), Field('default', label='Default value', has_arg=False, - names=('default')), + names=('default',)), Field('source', label='Values from', has_arg=False, names=('source', 'sources')), Field('deprecated', label='Deprecated', has_arg=False, - names=('deprecated')) + names=('deprecated',)) ]) From d4070e81d18d59135545b515cde69a552070ec9c Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 6 Feb 2023 14:03:28 +0800 Subject: [PATCH 03/26] Enable no_self_use --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index d9f5beb32..0524fd7b5 100644 --- a/tox.ini +++ b/tox.ini @@ -13,5 +13,5 @@ whitelist_externals = commands= python ./scripts/license_verify.py python setup.py check -r -s - pylint azdev --rcfile=.pylintrc -r n + pylint azdev --rcfile=.pylintrc -r n --load-plugins=pylint.extensions.no_self_use flake8 --statistics --append-config=.flake8 azdev From 1928f2990d5c58f98b0e1137aad0f33bcc2c1d39 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 6 Feb 2023 14:26:27 +0800 Subject: [PATCH 04/26] Minor fix --- .pylintrc | 3 ++- azdev/operations/performance.py | 2 +- azdev/operations/tests/test_benchmark.py | 2 +- azdev/operations/testtool/tests/test_profile_context.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index 51f762763..6a3cc492e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -10,7 +10,8 @@ disable= too-few-public-methods, too-many-arguments, consider-using-f-string, - unspecified-encoding + unspecified-encoding, + missing-timeout [TYPECHECK] # For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI diff --git a/azdev/operations/performance.py b/azdev/operations/performance.py index c705e822d..eb6377dd8 100644 --- a/azdev/operations/performance.py +++ b/azdev/operations/performance.py @@ -237,7 +237,7 @@ def _benchmark_cmd_staticstic(time_series: list): avg_time = sum(time_series) / size std_deviation = sqrt( - sum([(t - avg_time) * (t - avg_time) for t in time_series]) / size + sum((t - avg_time) * (t - avg_time) for t in time_series) / size ) return { diff --git a/azdev/operations/tests/test_benchmark.py b/azdev/operations/tests/test_benchmark.py index 327aabdf5..7f63e6556 100644 --- a/azdev/operations/tests/test_benchmark.py +++ b/azdev/operations/tests/test_benchmark.py @@ -25,7 +25,7 @@ def test_statistic_ok(self): max_num = round(rands[-1], 4) min_num = round(rands[0], 4) avg_num = round(sum(rands) / len(rands), 4) - std_num = round(sqrt(sum([(t - avg_num) ** 2 for t in rands]) / len(rands)), 4) + std_num = round(sqrt(sum((t - avg_num) ** 2 for t in rands) / len(rands)), 4) stats = _benchmark_cmd_staticstic(rands) diff --git a/azdev/operations/testtool/tests/test_profile_context.py b/azdev/operations/testtool/tests/test_profile_context.py index 2578b4e27..339105fe5 100644 --- a/azdev/operations/testtool/tests/test_profile_context.py +++ b/azdev/operations/testtool/tests/test_profile_context.py @@ -30,4 +30,4 @@ def test_unsupported_profile(self): def test_raise_inner_exception(self): with self.assertRaises(Exception): with ProfileContext('latest'): - raise Exception('inner Exception') + raise Exception('inner Exception') # pylint: disable=broad-except From c60042dfb37e302da387424768d5bbfab4640506 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 6 Feb 2023 14:31:56 +0800 Subject: [PATCH 05/26] Minor fix --- .pylintrc | 3 +-- azdev/operations/extensions/util.py | 2 +- azdev/operations/help/__init__.py | 2 +- azdev/operations/testtool/tests/test_profile_context.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pylintrc b/.pylintrc index 6a3cc492e..51f762763 100644 --- a/.pylintrc +++ b/.pylintrc @@ -10,8 +10,7 @@ disable= too-few-public-methods, too-many-arguments, consider-using-f-string, - unspecified-encoding, - missing-timeout + unspecified-encoding [TYPECHECK] # For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI diff --git a/azdev/operations/extensions/util.py b/azdev/operations/extensions/util.py index b0b916564..c3adeb185 100644 --- a/azdev/operations/extensions/util.py +++ b/azdev/operations/extensions/util.py @@ -69,7 +69,7 @@ def get_whl_from_url(url, filename, tmp_dir, whl_cache=None): if url in whl_cache: return whl_cache[url] import requests - r = requests.get(url, stream=True) + r = requests.get(url, stream=True) # pylint: disable=missing-timeout try: assert r.status_code == 200, "Request to {} failed with {}".format(url, r.status_code) except AssertionError: diff --git a/azdev/operations/help/__init__.py b/azdev/operations/help/__init__.py index a62b22cef..3e94ddf64 100644 --- a/azdev/operations/help/__init__.py +++ b/azdev/operations/help/__init__.py @@ -300,7 +300,7 @@ def _get_whl_from_url(url, filename, tmp_dir, whl_cache=None): if url in whl_cache: return whl_cache[url] import requests - r = requests.get(url, stream=True) + r = requests.get(url, stream=True) # pylint: disable=missing-timeout assert r.status_code == 200, "Request to {} failed with {}".format(url, r.status_code) ext_file = os.path.join(tmp_dir, filename) with open(ext_file, 'wb') as f: diff --git a/azdev/operations/testtool/tests/test_profile_context.py b/azdev/operations/testtool/tests/test_profile_context.py index 339105fe5..5a1cd458d 100644 --- a/azdev/operations/testtool/tests/test_profile_context.py +++ b/azdev/operations/testtool/tests/test_profile_context.py @@ -30,4 +30,4 @@ def test_unsupported_profile(self): def test_raise_inner_exception(self): with self.assertRaises(Exception): with ProfileContext('latest'): - raise Exception('inner Exception') # pylint: disable=broad-except + raise Exception('inner Exception') # pylint: disable=broad-except From 3a22e88567816cbab1a33de91c496fbeeaceddcc Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 6 Feb 2023 14:43:38 +0800 Subject: [PATCH 06/26] Minor fix --- azdev/operations/help/refdoc/common/directives.py | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azdev/operations/help/refdoc/common/directives.py b/azdev/operations/help/refdoc/common/directives.py index 0eb0b1faf..d07bad095 100644 --- a/azdev/operations/help/refdoc/common/directives.py +++ b/azdev/operations/help/refdoc/common/directives.py @@ -37,13 +37,13 @@ def handle_signature(self, sig, signode): signode += addnodes.desc_addname(sig, sig) return sig - def needs_arglist(self): # pylint: disable=no-self-use + def needs_arglist(self): return False def add_target_and_index(self, name, sig, signode): signode['ids'].append(name) - def get_index_text(self, modname, name): # pylint: disable=unused-argument, no-self-use + def get_index_text(self, modname, name): # pylint: disable=unused-argument return name diff --git a/tox.ini b/tox.ini index 0524fd7b5..d9f5beb32 100644 --- a/tox.ini +++ b/tox.ini @@ -13,5 +13,5 @@ whitelist_externals = commands= python ./scripts/license_verify.py python setup.py check -r -s - pylint azdev --rcfile=.pylintrc -r n --load-plugins=pylint.extensions.no_self_use + pylint azdev --rcfile=.pylintrc -r n flake8 --statistics --append-config=.flake8 azdev From 87cb41c0718a169293abba27125baa8c3a69f454 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 6 Feb 2023 14:50:23 +0800 Subject: [PATCH 07/26] Minor fix --- azdev/operations/pypi.py | 2 +- azdev/operations/testtool/tests/test_profile_context.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azdev/operations/pypi.py b/azdev/operations/pypi.py index 55009f47f..bf5b7053f 100644 --- a/azdev/operations/pypi.py +++ b/azdev/operations/pypi.py @@ -8,7 +8,7 @@ import re import sys -from distutils.version import LooseVersion # pylint:disable=import-error,no-name-in-module +from distutils.version import LooseVersion # pylint:disable=import-error,no-name-in-module,deprecated-module from docutils import core, io from knack.log import get_logger diff --git a/azdev/operations/testtool/tests/test_profile_context.py b/azdev/operations/testtool/tests/test_profile_context.py index 5a1cd458d..c249545d7 100644 --- a/azdev/operations/testtool/tests/test_profile_context.py +++ b/azdev/operations/testtool/tests/test_profile_context.py @@ -30,4 +30,4 @@ def test_unsupported_profile(self): def test_raise_inner_exception(self): with self.assertRaises(Exception): with ProfileContext('latest'): - raise Exception('inner Exception') # pylint: disable=broad-except + raise Exception('inner Exception') # pylint: disable=broad-exception-raised From 2fd99af251f1547a6be61420d4d592c175ec414c Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 6 Feb 2023 16:04:54 +0800 Subject: [PATCH 08/26] Fix flake8 --- azdev/config/cli.flake8 | 20 +++++++++++++------- azdev/config/ext.flake8 | 18 ++++++++++++------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/azdev/config/cli.flake8 b/azdev/config/cli.flake8 index c407d8e79..787ed6649 100644 --- a/azdev/config/cli.flake8 +++ b/azdev/config/cli.flake8 @@ -2,12 +2,18 @@ max-line-length = 120 max-complexity = 10 ignore = - E501, # line too long, it is covered by pylint - E722, # bare except, bad practice, to be removed in the future - F401, # imported but unused, too many violations, to be removed in the future - F811, # redefinition of unused, to be removed in the future - C901 # code flow is too complex, too many violations, to be removed in the future - W504 # line break after binary operator effect on readability is subjective + # line too long, it is covered by pylint + E501, + # bare except, bad practice, to be removed in the future + E722, + # imported but unused, too many violations, to be removed in the future + F401, + # redefinition of unused, to be removed in the future + F811, + # code flow is too complex, too many violations, to be removed in the future + C901, + # line break after binary operator effect on readability is subjective + W504 exclude = azure_cli_bdist_wheel.py build @@ -15,4 +21,4 @@ exclude = scripts doc build_scripts - */grammar/ \ No newline at end of file + */grammar/ diff --git a/azdev/config/ext.flake8 b/azdev/config/ext.flake8 index 39512a265..6b485739f 100644 --- a/azdev/config/ext.flake8 +++ b/azdev/config/ext.flake8 @@ -2,12 +2,18 @@ max-line-length = 120 max-complexity = 10 ignore = - E501, # line too long, it is covered by pylint - E722, # bare except, bad practice, to be removed in the future - F401, # imported but unused, too many violations, to be removed in the future - F811, # redefinition of unused, to be removed in the future - C901 # code flow is too complex, too many violations, to be removed in the future - W504 # line break after binary operator effect on readability is subjective + # line too long, it is covered by pylint + E501, + # bare except, bad practice, to be removed in the future + E722, + # imported but unused, too many violations, to be removed in the future + F401, + # redefinition of unused, to be removed in the future + F811, + # code flow is too complex, too many violations, to be removed in the future + C901, + # line break after binary operator effect on readability is subjective + W504 exclude = */vendored_sdks docs From 998a0bc3b5bd5d43747bb8634bced924a2f662b0 Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Fri, 10 Mar 2023 13:06:23 -0500 Subject: [PATCH 09/26] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8e97798a8..240232d72 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ 'gitpython', 'jinja2', 'knack', - 'pylint==2.16.1', + 'pylint==2.17.0', 'pytest-xdist', # depends on pytest-forked 'pytest-forked', 'pytest>=5.0.0', From 4cd84e756245b9fd7b610e740de1c2e6d8084a34 Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Fri, 10 Mar 2023 13:12:08 -0500 Subject: [PATCH 10/26] Update cli_pylintrc --- azdev/config/cli_pylintrc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/azdev/config/cli_pylintrc b/azdev/config/cli_pylintrc index 79248057b..3146cea0f 100644 --- a/azdev/config/cli_pylintrc +++ b/azdev/config/cli_pylintrc @@ -50,13 +50,13 @@ min-similarity-lines=10 # The invalid-name checker must be **enabled** for these hints to be used. include-naming-hint=yes -module-name-hint=lowercase (keep short; underscores are discouraged) -const-name-hint=UPPER_CASE_WITH_UNDERSCORES -class-name-hint=CapitalizedWords -class-attribute-name-hint=lower_case_with_underscores -attr-name-hint=lower_case_with_underscores -method-name-hint=lower_case_with_underscores -function-name-hint=lower_case_with_underscores -argument-name-hint=lower_case_with_underscores -variable-name-hint=lower_case_with_underscores -inlinevar-name-hint=lower_case_with_underscores (short is OK) +module-naming-style=snake_case +const-naming-style=UPPER_CASE +class-naming-style=PascalCase +class-attribute-naming-style=snake_case +attr-naming-style=snake_case +method-naming-style=snake_case +function-naming-style=snake_case +argument-naming-style=snake_case +variable-naming-style=snake_case +inlinevar-naming-style=snake_case From 7a2c4fe4ad1187d4a09e971e4a17351f1895bc6f Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Fri, 10 Mar 2023 13:15:07 -0500 Subject: [PATCH 11/26] Update ext_pylintrc --- azdev/config/ext_pylintrc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/azdev/config/ext_pylintrc b/azdev/config/ext_pylintrc index eae463151..8f9832e54 100644 --- a/azdev/config/ext_pylintrc +++ b/azdev/config/ext_pylintrc @@ -45,13 +45,14 @@ min-similarity-lines=10 # The invalid-name checker must be **enabled** for these hints to be used. include-naming-hint=yes -module-name-hint=lowercase (keep short; underscores are discouraged) -const-name-hint=UPPER_CASE_WITH_UNDERSCORES -class-name-hint=CapitalizedWords -class-attribute-name-hint=lower_case_with_underscores -attr-name-hint=lower_case_with_underscores -method-name-hint=lower_case_with_underscores -function-name-hint=lower_case_with_underscores -argument-name-hint=lower_case_with_underscores -variable-name-hint=lower_case_with_underscores -inlinevar-name-hint=lower_case_with_underscores (short is OK) +module-naming-style=snake_case +const-naming-style=UPPER_CASE +class-naming-style=PascalCase +class-attribute-naming-style=snake_case +attr-naming-style=snake_case +method-naming-style=snake_case +function-naming-style=snake_case +argument-naming-style=snake_case +variable-naming-style=snake_case +inlinevar-naming-style=snake_case + From a071b95136e3189b8a8b86e30c6d0bc269c1af2b Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:09:43 -0400 Subject: [PATCH 12/26] Update .pylintrc --- .pylintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 51f762763..b7000da53 100644 --- a/.pylintrc +++ b/.pylintrc @@ -10,7 +10,8 @@ disable= too-few-public-methods, too-many-arguments, consider-using-f-string, - unspecified-encoding + unspecified-encoding, + broad-exception-raised [TYPECHECK] # For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI From 1028936a4bc124577580449f92caa008bdc5ee01 Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:10:48 -0400 Subject: [PATCH 13/26] Apply suggestions from code review --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1136dc9a2..0fc9cbf5e 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ 'gitpython', 'jinja2', 'knack', - 'pylint==2.17.0', + 'pylint>2.11,<=2.17.1', 'pytest-xdist', # depends on pytest-forked 'pytest-forked', 'pytest>=5.0.0', From d207de8b2e359015f45a9d01fcb6b5d39fed5bbb Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:11:27 -0400 Subject: [PATCH 14/26] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0fc9cbf5e..b0cff6622 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ 'gitpython', 'jinja2', 'knack', - 'pylint>2.11,<=2.17.1', + 'pylint>=2.12,<=2.17.1', 'pytest-xdist', # depends on pytest-forked 'pytest-forked', 'pytest>=5.0.0', From 23cb1db42077c5b0ac46ee66204ff1917e99763c Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:11:46 -0400 Subject: [PATCH 15/26] Update azdev/operations/testtool/tests/test_profile_context.py --- azdev/operations/testtool/tests/test_profile_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azdev/operations/testtool/tests/test_profile_context.py b/azdev/operations/testtool/tests/test_profile_context.py index c249545d7..2578b4e27 100644 --- a/azdev/operations/testtool/tests/test_profile_context.py +++ b/azdev/operations/testtool/tests/test_profile_context.py @@ -30,4 +30,4 @@ def test_unsupported_profile(self): def test_raise_inner_exception(self): with self.assertRaises(Exception): with ProfileContext('latest'): - raise Exception('inner Exception') # pylint: disable=broad-exception-raised + raise Exception('inner Exception') From ec843637371efd4f96cef0f6b1a54cf9438da5e2 Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:14:41 -0400 Subject: [PATCH 16/26] Apply suggestions from code review --- .pylintrc | 3 ++- azdev/operations/extensions/util.py | 2 +- azdev/operations/help/__init__.py | 2 +- azdev/operations/pypi.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index b7000da53..cf159c15a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,7 +11,8 @@ disable= too-many-arguments, consider-using-f-string, unspecified-encoding, - broad-exception-raised + broad-exception-raised, + deprecated-module [TYPECHECK] # For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI diff --git a/azdev/operations/extensions/util.py b/azdev/operations/extensions/util.py index c3adeb185..88c0fffbe 100644 --- a/azdev/operations/extensions/util.py +++ b/azdev/operations/extensions/util.py @@ -69,7 +69,7 @@ def get_whl_from_url(url, filename, tmp_dir, whl_cache=None): if url in whl_cache: return whl_cache[url] import requests - r = requests.get(url, stream=True) # pylint: disable=missing-timeout + r = requests.get(url, stream=True, timeout=10) try: assert r.status_code == 200, "Request to {} failed with {}".format(url, r.status_code) except AssertionError: diff --git a/azdev/operations/help/__init__.py b/azdev/operations/help/__init__.py index 3e94ddf64..80b0df4db 100644 --- a/azdev/operations/help/__init__.py +++ b/azdev/operations/help/__init__.py @@ -300,7 +300,7 @@ def _get_whl_from_url(url, filename, tmp_dir, whl_cache=None): if url in whl_cache: return whl_cache[url] import requests - r = requests.get(url, stream=True) # pylint: disable=missing-timeout + r = requests.get(url, stream=True, timeout=10) assert r.status_code == 200, "Request to {} failed with {}".format(url, r.status_code) ext_file = os.path.join(tmp_dir, filename) with open(ext_file, 'wb') as f: diff --git a/azdev/operations/pypi.py b/azdev/operations/pypi.py index bf5b7053f..55009f47f 100644 --- a/azdev/operations/pypi.py +++ b/azdev/operations/pypi.py @@ -8,7 +8,7 @@ import re import sys -from distutils.version import LooseVersion # pylint:disable=import-error,no-name-in-module,deprecated-module +from distutils.version import LooseVersion # pylint:disable=import-error,no-name-in-module from docutils import core, io from knack.log import get_logger From 513539f1ed570ce0e35839993ce202a155023ebc Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:21:52 -0400 Subject: [PATCH 17/26] Update ext_pylintrc --- azdev/config/ext_pylintrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/azdev/config/ext_pylintrc b/azdev/config/ext_pylintrc index 8f9832e54..1bf684a54 100644 --- a/azdev/config/ext_pylintrc +++ b/azdev/config/ext_pylintrc @@ -16,7 +16,11 @@ disable= too-many-arguments, invalid-name, duplicate-code, - import-outside-toplevel + import-outside-toplevel, + # These rules were added in Pylint >= 2.12 and disabled to avoid making retroactively required + broad-exception-raised, + deprecated-module, + missing-timeout [TYPECHECK] # For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI From 664c6c84145d925894bc5b43e7c3c175a9aa05dc Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:22:14 -0400 Subject: [PATCH 18/26] Update cli_pylintrc --- azdev/config/cli_pylintrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/azdev/config/cli_pylintrc b/azdev/config/cli_pylintrc index 3146cea0f..71deb1801 100644 --- a/azdev/config/cli_pylintrc +++ b/azdev/config/cli_pylintrc @@ -25,7 +25,11 @@ disable= useless-import-alias, useless-suppression, import-outside-toplevel, - wrong-import-order + wrong-import-order, + # These rules were added in Pylint >= 2.12 and disabled to avoid making retroactively required + broad-exception-raised, + deprecated-module, + missing-timeout [FORMAT] max-line-length=120 From 074f8aa0871e5d661627d7df4336a17ed5470636 Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:22:33 -0400 Subject: [PATCH 19/26] Update .pylintrc --- .pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.pylintrc b/.pylintrc index cf159c15a..94e71f340 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,6 +11,7 @@ disable= too-many-arguments, consider-using-f-string, unspecified-encoding, + # These rules were added in Pylint >= 2.12 and disabled to avoid making retroactively required broad-exception-raised, deprecated-module From 510f0c19c75b33b487022f8573ee11cd4f1b2555 Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 23 May 2023 22:23:13 -0400 Subject: [PATCH 20/26] Apply suggestions from code review --- .pylintrc | 2 +- azdev/config/cli_pylintrc | 2 +- azdev/config/ext_pylintrc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pylintrc b/.pylintrc index 94e71f340..174084244 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,7 +11,7 @@ disable= too-many-arguments, consider-using-f-string, unspecified-encoding, - # These rules were added in Pylint >= 2.12 and disabled to avoid making retroactively required + # These rules were added in Pylint >= 2.12 and are disabled to avoid making retroactively required broad-exception-raised, deprecated-module diff --git a/azdev/config/cli_pylintrc b/azdev/config/cli_pylintrc index 71deb1801..cf85bbd76 100644 --- a/azdev/config/cli_pylintrc +++ b/azdev/config/cli_pylintrc @@ -26,7 +26,7 @@ disable= useless-suppression, import-outside-toplevel, wrong-import-order, - # These rules were added in Pylint >= 2.12 and disabled to avoid making retroactively required + # These rules were added in Pylint >= 2.12 and are disabled to avoid making retroactively required broad-exception-raised, deprecated-module, missing-timeout diff --git a/azdev/config/ext_pylintrc b/azdev/config/ext_pylintrc index 1bf684a54..982f5e4ea 100644 --- a/azdev/config/ext_pylintrc +++ b/azdev/config/ext_pylintrc @@ -17,7 +17,7 @@ disable= invalid-name, duplicate-code, import-outside-toplevel, - # These rules were added in Pylint >= 2.12 and disabled to avoid making retroactively required + # These rules were added in Pylint >= 2.12 and are disabled to avoid making retroactively required broad-exception-raised, deprecated-module, missing-timeout From f07822beaa2a980537fcbe613ce8c53c3bc59ce7 Mon Sep 17 00:00:00 2001 From: Hang Date: Fri, 30 Jun 2023 15:20:29 +0800 Subject: [PATCH 21/26] Update azdev/operations/help/__init__.py --- azdev/operations/help/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azdev/operations/help/__init__.py b/azdev/operations/help/__init__.py index 80b0df4db..a62b22cef 100644 --- a/azdev/operations/help/__init__.py +++ b/azdev/operations/help/__init__.py @@ -300,7 +300,7 @@ def _get_whl_from_url(url, filename, tmp_dir, whl_cache=None): if url in whl_cache: return whl_cache[url] import requests - r = requests.get(url, stream=True, timeout=10) + r = requests.get(url, stream=True) assert r.status_code == 200, "Request to {} failed with {}".format(url, r.status_code) ext_file = os.path.join(tmp_dir, filename) with open(ext_file, 'wb') as f: From a4623ce06a48855c5aa9cec144821c87dd3ccf05 Mon Sep 17 00:00:00 2001 From: Hang Date: Fri, 30 Jun 2023 15:20:49 +0800 Subject: [PATCH 22/26] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b0cff6622..2c29d6889 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ 'gitpython', 'jinja2', 'knack', - 'pylint>=2.12,<=2.17.1', + 'pylint>=2.12,<3', 'pytest-xdist', # depends on pytest-forked 'pytest-forked', 'pytest>=5.0.0', From 53f9b3d51d6d1919048ffa59cce093015ab9c944 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Fri, 30 Jun 2023 15:34:11 +0800 Subject: [PATCH 23/26] Ignore missing-timeout --- .pylintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 174084244..33449eb65 100644 --- a/.pylintrc +++ b/.pylintrc @@ -13,7 +13,8 @@ disable= unspecified-encoding, # These rules were added in Pylint >= 2.12 and are disabled to avoid making retroactively required broad-exception-raised, - deprecated-module + deprecated-module, + missing-timeout [TYPECHECK] # For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI From 0e60fba353c02333c6ea1f5ccb9d3d8976c28781 Mon Sep 17 00:00:00 2001 From: Hang Date: Wed, 12 Jul 2023 10:21:27 +0800 Subject: [PATCH 24/26] Minor fix --- .pylintrc | 2 +- azdev/config/cli_pylintrc | 2 +- azdev/config/ext_pylintrc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pylintrc b/.pylintrc index 33449eb65..8bb4e2118 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,7 +11,7 @@ disable= too-many-arguments, consider-using-f-string, unspecified-encoding, - # These rules were added in Pylint >= 2.12 and are disabled to avoid making retroactively required + # These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change broad-exception-raised, deprecated-module, missing-timeout diff --git a/azdev/config/cli_pylintrc b/azdev/config/cli_pylintrc index cf85bbd76..321572f93 100644 --- a/azdev/config/cli_pylintrc +++ b/azdev/config/cli_pylintrc @@ -26,7 +26,7 @@ disable= useless-suppression, import-outside-toplevel, wrong-import-order, - # These rules were added in Pylint >= 2.12 and are disabled to avoid making retroactively required + # These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change broad-exception-raised, deprecated-module, missing-timeout diff --git a/azdev/config/ext_pylintrc b/azdev/config/ext_pylintrc index 982f5e4ea..a4ecaaef8 100644 --- a/azdev/config/ext_pylintrc +++ b/azdev/config/ext_pylintrc @@ -17,7 +17,7 @@ disable= invalid-name, duplicate-code, import-outside-toplevel, - # These rules were added in Pylint >= 2.12 and are disabled to avoid making retroactively required + # These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change broad-exception-raised, deprecated-module, missing-timeout From f80f15001d57583ecc131142b02bf77ac2d67e9a Mon Sep 17 00:00:00 2001 From: Hang Date: Wed, 12 Jul 2023 16:27:18 +0800 Subject: [PATCH 25/26] Enable deprecated-module --- .pylintrc | 1 - azdev/config/cli_pylintrc | 1 - azdev/config/ext_pylintrc | 1 - azdev/operations/pypi.py | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index 8bb4e2118..7cbbb02c7 100644 --- a/.pylintrc +++ b/.pylintrc @@ -13,7 +13,6 @@ disable= unspecified-encoding, # These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change broad-exception-raised, - deprecated-module, missing-timeout [TYPECHECK] diff --git a/azdev/config/cli_pylintrc b/azdev/config/cli_pylintrc index 321572f93..5166704a2 100644 --- a/azdev/config/cli_pylintrc +++ b/azdev/config/cli_pylintrc @@ -28,7 +28,6 @@ disable= wrong-import-order, # These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change broad-exception-raised, - deprecated-module, missing-timeout [FORMAT] diff --git a/azdev/config/ext_pylintrc b/azdev/config/ext_pylintrc index a4ecaaef8..07e242a23 100644 --- a/azdev/config/ext_pylintrc +++ b/azdev/config/ext_pylintrc @@ -19,7 +19,6 @@ disable= import-outside-toplevel, # These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change broad-exception-raised, - deprecated-module, missing-timeout [TYPECHECK] diff --git a/azdev/operations/pypi.py b/azdev/operations/pypi.py index 55009f47f..bf5b7053f 100644 --- a/azdev/operations/pypi.py +++ b/azdev/operations/pypi.py @@ -8,7 +8,7 @@ import re import sys -from distutils.version import LooseVersion # pylint:disable=import-error,no-name-in-module +from distutils.version import LooseVersion # pylint:disable=import-error,no-name-in-module,deprecated-module from docutils import core, io from knack.log import get_logger From 08e6383b0969bf0fb3a99501560f24a4ded53105 Mon Sep 17 00:00:00 2001 From: Hang Date: Thu, 13 Jul 2023 16:10:40 +0800 Subject: [PATCH 26/26] Remove useless config --- azdev/config/cli_pylintrc | 18 ------------------ azdev/config/ext_pylintrc | 19 ------------------- 2 files changed, 37 deletions(-) diff --git a/azdev/config/cli_pylintrc b/azdev/config/cli_pylintrc index 5166704a2..2554cb0f5 100644 --- a/azdev/config/cli_pylintrc +++ b/azdev/config/cli_pylintrc @@ -45,21 +45,3 @@ max-branches=20 [SIMILARITIES] min-similarity-lines=10 - -[BASIC] -# Naming hints based on PEP 8 (https://www.python.org/dev/peps/pep-0008/#naming-conventions). -# Consider these guidelines and not hard rules. Read PEP 8 for more details. - -# The invalid-name checker must be **enabled** for these hints to be used. -include-naming-hint=yes - -module-naming-style=snake_case -const-naming-style=UPPER_CASE -class-naming-style=PascalCase -class-attribute-naming-style=snake_case -attr-naming-style=snake_case -method-naming-style=snake_case -function-naming-style=snake_case -argument-naming-style=snake_case -variable-naming-style=snake_case -inlinevar-naming-style=snake_case diff --git a/azdev/config/ext_pylintrc b/azdev/config/ext_pylintrc index 07e242a23..f0a07eb14 100644 --- a/azdev/config/ext_pylintrc +++ b/azdev/config/ext_pylintrc @@ -40,22 +40,3 @@ max-branches=20 [SIMILARITIES] min-similarity-lines=10 - -[BASIC] -# Naming hints based on PEP 8 (https://www.python.org/dev/peps/pep-0008/#naming-conventions). -# Consider these guidelines and not hard rules. Read PEP 8 for more details. - -# The invalid-name checker must be **enabled** for these hints to be used. -include-naming-hint=yes - -module-naming-style=snake_case -const-naming-style=UPPER_CASE -class-naming-style=PascalCase -class-attribute-naming-style=snake_case -attr-naming-style=snake_case -method-naming-style=snake_case -function-naming-style=snake_case -argument-naming-style=snake_case -variable-naming-style=snake_case -inlinevar-naming-style=snake_case -