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

[Bug]: Python emitter moves my # pylint: disable=protected-access around in _patch.py, make it no longer effective #5583

Open
4 tasks done
dargilco opened this issue Jan 13, 2025 · 0 comments
Labels
bug Something isn't working emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Comments

@dargilco
Copy link
Member

dargilco commented Jan 13, 2025

Describe the bug

I added the line # pylint: disable=protected-access in my _patch.py file to make a Pylint error go away. Note that it has to be in the same line as where the property is accessed, otherwise the error will not go away.

After re-emitting from TypeSpec, I see that _patch.py was edited, and the emitter decided to move # pylint: disable=protected-access to the end of the multi-line instruction. That results in the Pylint error appearing again.

Is there a way to fix the emitter to not do that? Thanks!

(and BTW the original multi-line instruction is a result of running the black tool black --config ../../../eng/black-pyproject.toml . It was the one who broke the line into multiple lines)

Screenshot of the diff after re-emitting:

Image

Reproduction

See above

Checklist

@dargilco dargilco added the bug Something isn't working label Jan 13, 2025
@markcowl markcowl added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working emitter:client:python Issue for the Python client emitter: @typespec/http-client-python
Projects
None yet
Development

No branches or pull requests

2 participants