-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
STYLE enable ruff PLW2901 #51797
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
STYLE enable ruff PLW2901 #51797
Changes from all commits
1f698b9
9cf095d
75b0878
ce55fbb
b11ad01
4579ddd
9ac4fab
4b3addf
9dfda14
1a40ee8
dc691e7
ffee8cd
b68f357
0477b9c
d2c07bb
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 |
---|---|---|
|
@@ -103,33 +103,33 @@ def get_api_items(api_doc_fd): | |
previous_line = current_section = current_subsection = "" | ||
position = None | ||
for line in api_doc_fd: | ||
line = line.strip() | ||
if len(line) == len(previous_line): | ||
if set(line) == set("-"): | ||
line_stripped = line.strip() | ||
if len(line_stripped) == len(previous_line): | ||
if set(line_stripped) == set("-"): | ||
current_section = previous_line | ||
continue | ||
if set(line) == set("~"): | ||
if set(line_stripped) == set("~"): | ||
current_subsection = previous_line | ||
continue | ||
|
||
if line.startswith(".. currentmodule::"): | ||
current_module = line.replace(".. currentmodule::", "").strip() | ||
if line_stripped.startswith(".. currentmodule::"): | ||
current_module = line_stripped.replace(".. currentmodule::", "").strip() | ||
continue | ||
|
||
if line == ".. autosummary::": | ||
if line_stripped == ".. autosummary::": | ||
position = "autosummary" | ||
continue | ||
|
||
if position == "autosummary": | ||
if line == "": | ||
if line_stripped == "": | ||
position = "items" | ||
continue | ||
|
||
if position == "items": | ||
if line == "": | ||
if line_stripped == "": | ||
position = None | ||
continue | ||
item = line.strip() | ||
item = line_stripped.strip() | ||
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. lol, the improved name you've chosen actually makes it clear that this line is probably unnecessary 😄 if you wanted to clean this up in a follow-up, that'd be welcome 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. Will defo follow up this topic. From this Sunday I will have time to dedicate to it :) |
||
if item in IGNORE_VALIDATION: | ||
continue | ||
func = importlib.import_module(current_module) | ||
|
@@ -143,7 +143,7 @@ def get_api_items(api_doc_fd): | |
current_subsection, | ||
) | ||
|
||
previous_line = line | ||
previous_line = line_stripped | ||
|
||
|
||
class PandasDocstring(Validator): | ||
|
Uh oh!
There was an error while loading. Please reload this page.