Skip to content

Commit

Permalink
[http-client-python] Fix lint issues (#4571)
Browse files Browse the repository at this point in the history
- Add changelog
- Fix lint issues
  • Loading branch information
msyyc authored Sep 30, 2024
1 parent 3fde27f commit f442b75
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
17 changes: 17 additions & 0 deletions packages/http-client-python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Change Log - @typespec/http-client-python

## 0.2.0

### Bug Fixes

- Fix lint issues

### Features

- Removed usage for some deprecated function of `@azure-tools/typespec-client-generator-core`

## 0.1.0

### Features

- Initial release
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ def pylint_disable(self) -> str:
retval = add_to_pylint_disable(retval, "client-accepts-api-version-keyword")
if len(self.operation_groups) > 6:
retval = add_to_pylint_disable(retval, "too-many-instance-attributes")
if len(self.name) > NAME_LENGTH_LIMIT:
retval = add_to_pylint_disable(retval, "name-too-long")
return retval

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% endif %}
{% set initialize_properties = serializer.initialize_properties(model) %}
{% if serializer.need_init(model) or initialize_properties %}
def __init__(self, *args: Any, **kwargs: Any) -> None:{{ serializer.pylint_disable(model) }}
def __init__(self, *args: Any, **kwargs: Any) -> None:{{ '# pylint: disable=useless-super-delegation' if not initialize_properties else '' }}
{% for line in serializer.super_call(model) %}
{{ line }}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

{% if code_model.need_mixin_abc %}
{% for client in clients | selectattr("has_mixin") %}
class {{ client.name }}MixinABC(
{% set pylint_disable = "# pylint: disable=name-too-long" if (client.name | length) + ("MixinABC" | length) > 40 else "" %}
class {{ client.name }}MixinABC( {{ pylint_disable }}
ABC
):
"""DO NOT use this class. It is for internal typing use only."""
Expand Down
4 changes: 2 additions & 2 deletions packages/http-client-python/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/http-client-python/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typespec/http-client-python",
"version": "0.1.0",
"version": "0.2.0",
"author": "Microsoft Corporation",
"description": "TypeSpec emitter for Python SDKs",
"homepage": "https://typespec.io",
Expand Down

0 comments on commit f442b75

Please sign in to comment.