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 Nov 22, 2023
1 parent 737d15e commit 2e05c73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ivy_lint/formatters/docs_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ivy_lint.formatters import BaseFormatter, BaseDocstringFormatter

class DocstringFormatter(BaseDocstringFormatter):
def format_docstring(doc):
def format_docstring(self, doc):
"""Formats a single docstring."""
# Rename "Functional Examples" to "Examples" and format it without the extra newline
doc = re.sub(r'(\s*)Functional Examples\n\1-*\n?', r'\1Examples\n\1--------\n', doc)
Expand Down Expand Up @@ -40,7 +40,7 @@ def format_docstring(doc):

return '\n'.join(formatted_lines)

def format_all_docstrings(python_code):
def format_all_docstrings(self, python_code):
"""Extracts all docstrings from the given Python code, formats them, and replaces the original ones with the formatted versions."""
tree = ast.parse(python_code)
replacements = {}
Expand Down

0 comments on commit 2e05c73

Please sign in to comment.