From 86c6fc4b645f893b2ff03d9292426b92065e34e8 Mon Sep 17 00:00:00 2001 From: necusjz Date: Fri, 2 Oct 2026 11:45:29 +1000 Subject: [PATCH 1/2] fix: lint --- src/azure-cli-core/azure/cli/core/commands/arm.py | 7 +++---- .../acs/azurecontainerstorage/_validators.py | 2 +- .../azure/cli/command_modules/acs/custom.py | 12 ++++++------ .../azure/cli/command_modules/sql/custom.py | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/azure-cli-core/azure/cli/core/commands/arm.py b/src/azure-cli-core/azure/cli/core/commands/arm.py index de96783c6f4..d9a35e03f91 100644 --- a/src/azure-cli-core/azure/cli/core/commands/arm.py +++ b/src/azure-cli-core/azure/cli/core/commands/arm.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - +# pylint: disable=line-too-long # pylint: disable=too-many-lines import argparse @@ -75,7 +75,7 @@ def add_output(self, key, property_name, provider=None, property_type=None, output_type='string', path=None): if provider and property_type: - value = "[reference(resourceId('{provider}/{type}', '{property}'),providers('{provider}', '{type}').apiVersions[0])".format( # pylint: disable=line-too-long + value = "[reference(resourceId('{provider}/{type}', '{property}'),providers('{provider}', '{type}').apiVersions[0])".format( provider=provider, type=property_type, property=property_name) else: value = "[reference('{}')".format(property_name) @@ -175,8 +175,7 @@ def __new__(cls, val): return str.__new__(cls, val) -def resource_exists(cli_ctx, subscription, resource_group, name, namespace, type, - **_): # pylint: disable=redefined-builtin +def resource_exists(cli_ctx, subscription, resource_group, name, namespace, type, **_): # pylint: disable=redefined-builtin ''' Checks if the given resource exists. ''' odata_filter = "resourceGroup eq '{}' and name eq '{}'" \ " and resourceType eq '{}/{}'".format(resource_group, name, namespace, type) diff --git a/src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage/_validators.py b/src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage/_validators.py index a817519b376..1486aaf6af3 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage/_validators.py +++ b/src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage/_validators.py @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +# pylint: disable=too-many-boolean-expressions import re @@ -357,7 +358,6 @@ def validate_enable_azure_container_storage_v1_params( # pylint: disable=too-ma f'value set to {existing_ephemeral_disk_nvme_perf_tier}.' ) - # pylint: disable=too-many-boolean-expressions if required_type_installed_for_disk_vol_type and \ ephemeral_disk_volume_type is not None and \ existing_ephemeral_disk_volume_type.lower() == ephemeral_disk_volume_type.lower() and \ diff --git a/src/azure-cli/azure/cli/command_modules/acs/custom.py b/src/azure-cli/azure/cli/command_modules/acs/custom.py index 46e2e68fbf5..1b00dd20b6d 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/custom.py @@ -1083,8 +1083,8 @@ def aks_create( existing_mc = None try: existing_mc = client.get(resource_group_name, name) - # pylint: disable=broad-except - except Exception as ex: + + except Exception as ex: # pylint: disable=broad-exception-caught logger.debug("failed to get cluster, error: %s", ex) if existing_mc: raise ClientRequestError( @@ -2942,8 +2942,8 @@ def append_install_dir_to_windows_user_path(install_dir, binary_name): user_path = "" try: user_path = get_windows_user_path() - # pylint: disable=broad-except - except Exception as e: + + except Exception as e: # pylint: disable=broad-exception-caught logger.debug("failed to get user path, error: %s", e) log_windows_post_installation_manual_steps_warning( install_dir, binary_name) @@ -2960,8 +2960,8 @@ def append_install_dir_to_windows_user_path(install_dir, binary_name): try: subprocess.run(setxexp, shell=True, check=True, capture_output=True) log_windows_successful_installation_warning(install_dir) - # pylint: disable=broad-except - except Exception as e: + + except Exception as e: # pylint: disable=broad-exception-caught logger.debug("failed to set user path, error: %s", e) log_windows_post_installation_manual_steps_warning( install_dir, binary_name) diff --git a/src/azure-cli/azure/cli/command_modules/sql/custom.py b/src/azure-cli/azure/cli/command_modules/sql/custom.py index bc1d20123d9..b1e4ee168a6 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/custom.py +++ b/src/azure-cli/azure/cli/command_modules/sql/custom.py @@ -1787,7 +1787,7 @@ def db_delete_replica_link( # provided. We don't care about this parameter and it gets handled weirdly if we # expliclty specify it with default value here (e.g. `yes=None` or `yes=True`), receiving # it in kwargs seems to work. - **kwargs): # pylint: disable=unused-argument + **_kwargs): ''' Deletes a replication link. ''' From 1f1393234146dc45d89e290c90eb376e9e2d91bb Mon Sep 17 00:00:00 2001 From: necusjz Date: Fri, 2 Oct 2026 14:53:45 +1000 Subject: [PATCH 2/2] fix: lint --- src/azure-cli/azure/cli/command_modules/sql/custom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/sql/custom.py b/src/azure-cli/azure/cli/command_modules/sql/custom.py index b1e4ee168a6..0bcdd69f980 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/custom.py +++ b/src/azure-cli/azure/cli/command_modules/sql/custom.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - +# pylint: disable=unused-argument # pylint: disable=C0302 from enum import Enum import calendar @@ -1787,7 +1787,7 @@ def db_delete_replica_link( # provided. We don't care about this parameter and it gets handled weirdly if we # expliclty specify it with default value here (e.g. `yes=None` or `yes=True`), receiving # it in kwargs seems to work. - **_kwargs): + **kwargs): ''' Deletes a replication link. '''