Skip to content

chore: Format docstrings to adhere to PEP 257 guidelines#4

Merged
sumansaurabh merged 1 commit intomainfrom
SDG-581/pep-257-convention
May 24, 2024
Merged

chore: Format docstrings to adhere to PEP 257 guidelines#4
sumansaurabh merged 1 commit intomainfrom
SDG-581/pep-257-convention

Conversation

@sumansaurabh
Copy link
Copy Markdown
Contributor

This pull request includes changes to the CONTRIBUTION.md guidelines, as well as updates to the PyDocSmith library to improve the formatting of docstrings. The changes in PyDocSmith include the addition of a new function to format docstrings according to PEP 257, and updates to the compose function to use this new formatting function. The changes also include updates to the tests to verify the new functionality.

Updates to contribution guidelines:

  • CONTRIBUTION.md: Added guidelines for reporting issues, submitting changes, code of conduct, writing poetry, and review process.

Improvements to docstring formatting:

  • PyDocSmith/common.py: Added textwrap module for text wrapping, updated the meta attribute in the Docstring class to use type hinting, and added a new function format_docstring_to_pep257 to format docstrings according to PEP 257. [1] [2] [3]
  • PyDocSmith/parser.py: Imported the format_docstring_to_pep257 function, added a line_width parameter to the compose function, and updated the compose function to use the format_docstring_to_pep257 function when line_width is greater than or equal to 72. [1] [2] [3]

Updates to tests:

  • PyDocSmith/tests/test_google.py: Imported the format_docstring_to_pep257 function, added a new test test_very_long_content_for_format_docstring_to_pep257 to verify the new formatting function, and updated the test_unformatted_valid_docstring test to use the compose function. [1] [2] [3]

@sumansaurabh sumansaurabh merged commit e11ddfb into main May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant