Skip to content

Commit

Permalink
🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Jan 7, 2025
1 parent 7036414 commit eb971c0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions utils/remove_docstring_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ def visit_FunctionDef(self, node: ast.FunctionDef) -> None: # noqa: N802
and "Examples:" in docstring
and value.end_lineno is not None
):
examples_line_start = value.lineno + [
line.strip() for line in docstring.splitlines()
].index("Examples:")
docstring_lines = [line.strip() for line in docstring.splitlines()]
examples_line_start = value.lineno + docstring_lines.index("Examples:")
examples_line_end = value.end_lineno
self.to_remove.append((examples_line_start, examples_line_end))

Expand Down

0 comments on commit eb971c0

Please sign in to comment.