Skip to content

Commit

Permalink
disable missing cred param pylint (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Jun 29, 2022
1 parent d825d41 commit 32fc34a
Show file tree
Hide file tree
Showing 224 changed files with 667 additions and 222 deletions.
15 changes: 15 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Release History

### 2022-xx-xx - 6.0.1

| Library | Min Version |
| ----------------------------------------------------------------------- | ----------- |
| `@autorest/core` | `3.8.1` |
| `@autorest/modelerfour` | `4.23.5` |
| `azure-core` dep of generated code | `1.24.0` |
| `isodate` dep of generated code | `0.6.1` |
| `msrest` dep of generated code (If generating legacy code) | `0.7.1` |
| `azure-mgmt-core` dep of generated code (If generating mgmt plane code) | `1.3.0` |

**Bug Fixes**

- Ignore linting error for clients with no credentials #1333

### 2022-06-24 - 6.0.0

| Library | Min Version |
Expand Down
6 changes: 6 additions & 0 deletions autorest/codegen/serializers/client_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ def __init__(self, code_model: CodeModel) -> None:
self.parameter_serializer = ParameterSerializer()

def _init_signature(self, async_mode: bool) -> str:
pylint_disable = ""
if not self.code_model.client.parameters.credential:
pylint_disable = (
" # pylint: disable=missing-client-constructor-parameter-credential"
)
return self.parameter_serializer.serialize_method(
function_def="def",
method_name="__init__",
need_self_param=True,
method_param_signatures=self.code_model.client.parameters.method_signature(
async_mode
),
pylint_disable=pylint_disable,
)

def init_signature_and_response_type_annotation(self, async_mode: bool) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class AutoRestHeadTestService: # pylint: disable=client-accepts-api-version-key
:paramtype endpoint: str
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestHeadTestServiceConfiguration(**kwargs)
self._client = PipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class AutoRestHeadTestService: # pylint: disable=client-accepts-api-version-key
:paramtype endpoint: str
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestHeadTestServiceConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class PollingPagingExample(PollingPagingExampleOperationsMixin): # pylint: disa
Retry-After header is present.
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = PollingPagingExampleConfiguration(**kwargs)
self._client = PipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class PollingPagingExample(PollingPagingExampleOperationsMixin): # pylint: disa
Retry-After header is present.
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = PollingPagingExampleConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/python",
"version": "6.0.0",
"version": "6.0.1",
"description": "The Python extension for generators in AutoRest.",
"scripts": {
"prepare": "node run-python3.js prepare.py",
Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ignore=_generated,samples,examples,test,tests,doc,.tox
# cyclic-import: because of https://github.com/PyCQA/pylint/issues/850
# too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods.
# Let's black deal with bad-continuation
disable=useless-object-inheritance,missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,bad-continuation,check-docstrings,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,missing-client-constructor-parameter-credential,client-suffix-needed,client-accepts-api-version-keyword
disable=useless-object-inheritance,missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,bad-continuation,check-docstrings,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,client-suffix-needed

[FORMAT]
max-line-length=120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class AutoRestDurationTestService: # pylint: disable=client-accepts-api-version
:type base_url: str
"""

def __init__(self, base_url: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, base_url: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestDurationTestServiceConfiguration(**kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class AutoRestDurationTestService: # pylint: disable=client-accepts-api-version
:type base_url: str
"""

def __init__(self, base_url: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, base_url: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestDurationTestServiceConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class AutoRestParameterGroupingTestService: # pylint: disable=client-accepts-ap
:type base_url: str
"""

def __init__(self, base_url: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, base_url: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestParameterGroupingTestServiceConfiguration(**kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class AutoRestParameterGroupingTestService: # pylint: disable=client-accepts-ap
:type base_url: str
"""

def __init__(self, base_url: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, base_url: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestParameterGroupingTestServiceConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class AutoRestReportServiceForAzure(
:type base_url: str
"""

def __init__(self, base_url: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, base_url: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestReportServiceForAzureConfiguration(**kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class AutoRestReportServiceForAzure(
:type base_url: str
"""

def __init__(self, base_url: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, base_url: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestReportServiceForAzureConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class AutoRestParameterizedHostTestClient: # pylint: disable=client-accepts-api
:type host: str
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = AutoRestParameterizedHostTestClientConfiguration(host=host, **kwargs)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class AutoRestParameterizedHostTestClient: # pylint: disable=client-accepts-api
:type host: str
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = AutoRestParameterizedHostTestClientConfiguration(host=host, **kwargs)
self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class AutoRestParameterizedHostTestPagingClient: # pylint: disable=client-accep
:type host: str
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = AutoRestParameterizedHostTestPagingClientConfiguration(host=host, **kwargs)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class AutoRestParameterizedHostTestPagingClient: # pylint: disable=client-accep
:type host: str
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = AutoRestParameterizedHostTestPagingClientConfiguration(host=host, **kwargs)
self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class LROWithParamaterizedEndpoints(
Retry-After header is present.
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = LROWithParamaterizedEndpointsConfiguration(host=host, **kwargs)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class LROWithParamaterizedEndpoints(
Retry-After header is present.
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = LROWithParamaterizedEndpointsConfiguration(host=host, **kwargs)
self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class AutoRestPagingTestService: # pylint: disable=client-accepts-api-version-k
Retry-After header is present.
"""

def __init__(self, base_url: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, base_url: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestPagingTestServiceConfiguration(**kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class AutoRestPagingTestService: # pylint: disable=client-accepts-api-version-k
Retry-After header is present.
"""

def __init__(self, base_url: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, base_url: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestPagingTestServiceConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class AutoRestDurationTestService: # pylint: disable=client-accepts-api-version
:paramtype endpoint: str
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestDurationTestServiceConfiguration(**kwargs)
self._client = PipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class AutoRestDurationTestService: # pylint: disable=client-accepts-api-version
:paramtype endpoint: str
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestDurationTestServiceConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class AutoRestParameterGroupingTestService: # pylint: disable=client-accepts-ap
:paramtype endpoint: str
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestParameterGroupingTestServiceConfiguration(**kwargs)
self._client = PipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class AutoRestParameterGroupingTestService: # pylint: disable=client-accepts-ap
:paramtype endpoint: str
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestParameterGroupingTestServiceConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class AutoRestReportServiceForAzure(
:paramtype endpoint: str
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestReportServiceForAzureConfiguration(**kwargs)
self._client = PipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class AutoRestReportServiceForAzure(
:paramtype endpoint: str
"""

def __init__(self, *, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, *, endpoint: str = "http://localhost:3000", **kwargs: Any
) -> None:
self._config = AutoRestReportServiceForAzureConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=endpoint, config=self._config, **kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class AutoRestParameterizedHostTestClient: # pylint: disable=client-accepts-api
:type host: str
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = AutoRestParameterizedHostTestClientConfiguration(host=host, **kwargs)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class AutoRestParameterizedHostTestClient: # pylint: disable=client-accepts-api
:type host: str
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = AutoRestParameterizedHostTestClientConfiguration(host=host, **kwargs)
self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class AutoRestParameterizedHostTestPagingClient: # pylint: disable=client-accep
:type host: str
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = AutoRestParameterizedHostTestPagingClientConfiguration(host=host, **kwargs)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class AutoRestParameterizedHostTestPagingClient: # pylint: disable=client-accep
:type host: str
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = AutoRestParameterizedHostTestPagingClientConfiguration(host=host, **kwargs)
self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class LROWithParamaterizedEndpoints(
Retry-After header is present.
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = LROWithParamaterizedEndpointsConfiguration(host=host, **kwargs)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class LROWithParamaterizedEndpoints(
Retry-After header is present.
"""

def __init__(self, host: str = "host", **kwargs: Any) -> None:
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, host: str = "host", **kwargs: Any
) -> None:
_endpoint = "http://{accountName}{host}"
self._config = LROWithParamaterizedEndpointsConfiguration(host=host, **kwargs)
self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)
Expand Down
Loading

0 comments on commit 32fc34a

Please sign in to comment.