-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
resources
imported but unused
#4250
Comments
Can you provide a minimal reproducible code example? |
Would adding a noqa be fine for your use case? |
minimal example code: |
No I want to see this error for other import code |
I guess a setting could be added to ignore |
How? |
It needs to be implemented. |
Do you import |
Yes |
Can you explain how can I implement this? |
I can implement it if you want. |
I want to help you and contributing in this project. |
We can add |
To implement this you can look up CONTRIBUTING.md/#example-adding-a-new-configuration-option. |
To clarify, you can ignore the unused import only for that line with: import resources # noqa: F401 That will prevent an unused import error from appearing for that line, but won't prevent other imports from being marked as unused. |
Right, but what if I want import like this? from ImportFrom import OtherName, _Name I can do like this but it's ugly: from ImportFrom import OtherName
from ImportFrom import _Name # noqa: F401 (This is solved in #4691 ) |
I think the conventional way to format that would be: from ImportFrom import (
OtherName,
_Name, # noqa: F401
) |
resources.py
must imported to useQt resources
in projectresources file will generated by:
pyrcc5 resources.qrc -o "./resources.py"
how can I tell ruff to ignore resources import error??
ruff output:
window.py:22:26: F401 [*] resources imported but unused
pyproject.toml:
ruff version:
ruff 0.0.264
The text was updated successfully, but these errors were encountered: