From 287b257cbda2fe6fe5dc7ee136656716ec9a766e Mon Sep 17 00:00:00 2001 From: Bhushan Srivastava <59949692+he11owthere@users.noreply.github.com> Date: Fri, 1 Dec 2023 22:57:30 +0530 Subject: [PATCH] Update docs_formatter.py --- ivy_lint/formatters/docs_formatter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ivy_lint/formatters/docs_formatter.py b/ivy_lint/formatters/docs_formatter.py index b7d1a28..89a730b 100644 --- a/ivy_lint/formatters/docs_formatter.py +++ b/ivy_lint/formatters/docs_formatter.py @@ -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 @@ -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) @@ -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 = []