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
MAINT/STY: misc: remove E501 (line length) lint ignore #19491
Conversation
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.
Have you looked for unspecific uses of noqa
in misc that are being used just for E501?
scipy/misc/_common.py
Outdated
@@ -332,7 +334,7 @@ def electrocardiogram(): | |||
>>> plt.ylabel("Power spectrum of the ECG in mV**2") | |||
>>> plt.xlim(f[[0, -1]]) | |||
>>> plt.show() | |||
""" | |||
""" # noqa: E501 |
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.
Is this because of the URL? By changing the label to something shorter than "_record 208", I think this can fit within the new limit.
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.
Actually, when I run python tools/lint.py scipy/misc/_common.py
locally on main
(with E501 exception removed from lint.toml ), I don't see an error here. Any guesses why?
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.
The correct usage is python tools/lint.py --files scipy/misc/_common.py
, which shows the error for me locally.
Edit: no you're right, I only get the error on line 229. Maybe the linter is happy because it's in a docstring. Will remove the noqa
.
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.
It seems like it doesn't apply to docstrings: astral-sh/ruff#1784 (comment)
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.
Yep, the code for doc-length is W505
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.
Okay, E501 actually does apply to docstrings, but it lets URLs run over 👍
Just checked and there are no unspecific uses of |
|
I had considered this but I thought we may as well deal with it for completeness as it's so quick. |
860f1cc
to
6a8d4cf
Compare
Looks good! In the next PR, please have CI show that the lint check fails (adding a dummy change to a file if needed), then add a commit that fixes it. Thanks! |
This is an argument for having a skip for everything but lint! PRs welcome : ) |
Reference issue
Towards gh-19479.
What does this implement/fix?
Follow-up to gh-19489 for
misc
.Additional information