diff --git a/pylintrc b/pylintrc index 3e0ad5f95e..09089ed5c3 100644 --- a/pylintrc +++ b/pylintrc @@ -11,7 +11,7 @@ disable=missing-docstring,locally-disabled,fixme,cyclic-import,too-many-argument [TYPECHECK] # For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI -ignored-modules=azure,azure.cli,azure.cli.core,azure.cli.core.commands,knack +ignored-modules=azure,azure.cli,azure.cli.core,azure.cli.core.commands,knack,msrestazure,argcomplete [FORMAT] max-line-length=120 diff --git a/src/storage-preview/azext_storage_preview/_params.py b/src/storage-preview/azext_storage_preview/_params.py index b10c70f592..454a2121a2 100644 --- a/src/storage-preview/azext_storage_preview/_params.py +++ b/src/storage-preview/azext_storage_preview/_params.py @@ -328,8 +328,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.register_source_uri_arguments(validator=validate_source_uri) with self.argument_context('storage blob copy start-batch', arg_group='Copy Source') as c: - from ._validators import (get_source_file_or_blob_service_client, - process_blob_copy_batch_namespace) + from ._validators import (get_source_file_or_blob_service_client, process_blob_copy_batch_namespace) c.argument('source_client', ignore_type, validator=get_source_file_or_blob_service_client) diff --git a/src/storage-preview/azext_storage_preview/commands.py b/src/storage-preview/azext_storage_preview/commands.py index 1c742f3c89..49442aba2e 100644 --- a/src/storage-preview/azext_storage_preview/commands.py +++ b/src/storage-preview/azext_storage_preview/commands.py @@ -3,14 +3,14 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +from azure.cli.core.commands import CliCommandType +from azure.cli.core.profiles import ResourceType from ._client_factory import (cf_sa, blob_data_service_factory, page_blob_service_factory, file_data_service_factory, queue_data_service_factory, table_data_service_factory, cloud_storage_account_service_factory, multi_service_properties_factory) from .sdkutil import cosmosdb_table_exists -from azure.cli.core.commands import CliCommandType -from azure.cli.core.profiles import ResourceType def load_command_table(self, _): # pylint: disable=too-many-locals, too-many-statements diff --git a/src/storage-preview/azext_storage_preview/storage_url_helpers.py b/src/storage-preview/azext_storage_preview/storage_url_helpers.py index c6df2820f8..a79d607068 100644 --- a/src/storage-preview/azext_storage_preview/storage_url_helpers.py +++ b/src/storage-preview/azext_storage_preview/storage_url_helpers.py @@ -22,8 +22,8 @@ def __init__(self, cloud, moniker): self.snapshot = None self.sas_token = None - from six.moves.urllib.parse import urlparse # pylint: disable=import-error - url = urlparse(moniker) + from six.moves import urllib_parse # pylint: disable=import-error + url = urllib_parse.urlparse(moniker) self._is_url = (url.scheme == 'http' or url.scheme == 'https') if not self._is_url: diff --git a/src/storage-preview/azext_storage_preview/tests/latest/storage_test_util.py b/src/storage-preview/azext_storage_preview/tests/latest/storage_test_util.py index 9c7967c76c..3fd585bee6 100644 --- a/src/storage-preview/azext_storage_preview/tests/latest/storage_test_util.py +++ b/src/storage-preview/azext_storage_preview/tests/latest/storage_test_util.py @@ -56,7 +56,7 @@ def __init__(self, parameter_name='test_dir'): super(StorageTestFilesPreparer, self).__init__(name_prefix='test', name_len=24) self.parameter_name = parameter_name - def create_resource(self, name, **kwargs): + def create_resource(self, _name, **_kwargs): temp_dir = os.path.join(tempfile.gettempdir(), self.random_name) if not os.path.exists(temp_dir): os.mkdir(temp_dir) @@ -78,7 +78,7 @@ def create_resource(self, name, **kwargs): setattr(self, '_temp_dir', temp_dir) return {self.parameter_name: temp_dir} - def remove_resource(self, name, **kwargs): + def remove_resource(self, _name, **_kwargs): temp_dir = self.get_temp_dir() if temp_dir: shutil.rmtree(temp_dir, ignore_errors=True) diff --git a/src/storage-preview/azext_storage_preview/url_quote_util.py b/src/storage-preview/azext_storage_preview/url_quote_util.py index 49f269d63e..0055bf93e8 100644 --- a/src/storage-preview/azext_storage_preview/url_quote_util.py +++ b/src/storage-preview/azext_storage_preview/url_quote_util.py @@ -13,15 +13,16 @@ def encode_for_url(url_component, safe=SAFE_CHARS): - from six.moves.urllib.parse import quote as url_quote # pylint: disable=import-error + from six.moves import urllib_parse # pylint: disable=import-error + url_quote = urllib_parse.quote return url_quote(url_component, safe) def encode_url_path(url, safe=SAFE_CHARS): - from six.moves.urllib.parse import urlparse, urlunparse # pylint: disable=import-error - url_parts = urlparse(url) + from six.moves import urllib_parse # pylint: disable=import-error + url_parts = urllib_parse.urlparse(url) quoted_path = encode_for_url(url_parts.path, safe) - return urlunparse(url_parts[:2] + (quoted_path,) + url_parts[3:]) + return urllib_parse.urlunparse(url_parts[:2] + (quoted_path,) + url_parts[3:]) def make_encoded_file_url_and_params(file_service, share, file_dir, file_name, sas_token, safe=SAFE_CHARS):