Skip to content

Commit

Permalink
Update docs_formatter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
he11owthere authored Dec 1, 2023
1 parent 60cd1c8 commit 287b257
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ivy_lint/formatters/docs_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def format_docstring(self, doc):
is_codeblock = False
codeblock_start_lines = set() # This will store indices of lines which start a code block
lines_to_modify = set() # This will store the indices of indented lines not containing "..."
prev_line = ""
is_codeblock_cont = False
lb = 0
rb = 0
Expand All @@ -35,7 +36,7 @@ def format_docstring(self, doc):
stripped_line = line.strip()
if stripped_line.startswith('-') and stripped_line.endswith('-'):
section_title = prev_line
validate_section_name(section_title, VALID_SECTION_NAMES)
self.validate_section_name(section_title, VALID_SECTION_NAMES)
if not is_codeblock and stripped_line.startswith('>>>'):
is_codeblock = True
codeblock_start_lines.add(idx)
Expand All @@ -56,7 +57,7 @@ def format_docstring(self, doc):
is_codeblock_cont = True
if not stripped_line.startswith(('>>>', '...')):
lines_to_modify.add(idx)
prev_line = stripped_line
prev_line = stripped_line

# Add blank lines before code blocks
formatted_lines = []
Expand Down

0 comments on commit 287b257

Please sign in to comment.