Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] don't add too-many-lines disable if already exists #5539

Merged
merged 12 commits into from
Jan 9, 2025
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,4 @@ BenchmarkDotnet.Artifacts/
packages/http-client-python/generator/test/**/generated/
packages/http-client-python/generator/test/**/cadl-ranch-coverage.json
!packages/http-client-python/package-lock.json
packages/http-client-python/micropip.lock
10 changes: 10 additions & 0 deletions packages/http-client-python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
# Change Log - @typespec/http-client-python

## 0.6.1

### Bug Fixes

- Only add linting disables for a file with too many lines if the file doesn't already disable this linter rule

## 0.6.0

### Features

- Add support for typespec namespace

### Bug Fixes

- Only add linting disables for a file with too many lines if the file doesn't already disable this linter rule

## 0.5.1

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/http-client-python/generator/pygen/black.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def format_file(self, file: Path) -> None:
except:
_LOGGER.error("Error: failed to format %s", file)
raise
if len(file_content.splitlines()) > 1000:
if len(file_content.splitlines()) > 1000 and "pylint: disable=too-many-lines" not in file_content:
file_content = "# pylint: disable=too-many-lines\n" + file_content
self.write_file(file, file_content)

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.6.0",
"version": "0.6.1",
"author": "Microsoft Corporation",
iscai-msft marked this conversation as resolved.
Show resolved Hide resolved
"description": "TypeSpec emitter for Python SDKs",
"homepage": "https://typespec.io",
Expand Down
Loading