-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[flake8-naming
]: Respect import conventions (N817
)
#12922
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
import mod.CaMel as CM | ||
from mod import CamelCase as CC | ||
|
||
|
||
# OK depending on configured import convention | ||
import xml.etree.ElementTree as ET |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pep8_naming/mod.rs | ||
--- | ||
N817.py:1:8: N817 CamelCase `CaMel` imported as acronym `CM` | ||
| | ||
1 | import mod.CaMel as CM | ||
| ^^^^^^^^^^^^^^^ N817 | ||
2 | from mod import CamelCase as CC | ||
| | ||
|
||
N817.py:2:17: N817 CamelCase `CamelCase` imported as acronym `CC` | ||
| | ||
1 | import mod.CaMel as CM | ||
2 | from mod import CamelCase as CC | ||
| ^^^^^^^^^^^^^^^ N817 | ||
| | ||
|
||
N817.py:6:8: N817 CamelCase `ElementTree` imported as acronym `ET` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The configuration for this test run specifies that the convention for importing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the pre-existing test ensures that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
| | ||
5 | # OK depending on configured import convention | ||
6 | import xml.etree.ElementTree as ET | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ N817 | ||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I notice you used square brackets but didn't add a link at the end. Was that deliberate -- do we have a mechanism that adds links automatically to settings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have some fancy script that resolves settings (and validates them)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fancy script or no fancy script, you're still referring to the wrong setting here: the
lint.flake8-boolean-trap.extend-allowed-calls
setting has nothing to do with this ruleThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed #12935 to address this