format-docstring 0.3.0__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. {format_docstring-0.3.0 → format_docstring-0.4.2}/.pre-commit-config.yaml +19 -6
  2. {format_docstring-0.3.0 → format_docstring-0.4.2}/AGENTS.md +7 -0
  3. {format_docstring-0.3.0 → format_docstring-0.4.2}/CHANGELOG.md +45 -0
  4. {format_docstring-0.3.0 → format_docstring-0.4.2}/PKG-INFO +106 -24
  5. {format_docstring-0.3.0 → format_docstring-0.4.2}/README.md +105 -23
  6. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/config.py +105 -0
  7. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/docstring_rewriter.py +189 -1
  8. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/line_wrap_google.py +251 -68
  9. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/line_wrap_numpy.py +145 -68
  10. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/line_wrap_utils.py +112 -3
  11. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/main_jupyter.py +52 -1
  12. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/main_py.py +51 -3
  13. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring.egg-info/PKG-INFO +106 -24
  14. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring.egg-info/SOURCES.txt +12 -0
  15. {format_docstring-0.3.0 → format_docstring-0.4.2}/muff.toml +1 -0
  16. {format_docstring-0.3.0 → format_docstring-0.4.2}/pyproject.toml +1 -1
  17. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_config.py +243 -1
  18. format_docstring-0.4.2/tests/test_data/end_to_end/cli_options/google/include_arg_defaults_false.txt +133 -0
  19. format_docstring-0.4.2/tests/test_data/end_to_end/cli_options/google/include_arg_types_and_defaults_false.txt +83 -0
  20. format_docstring-0.4.2/tests/test_data/end_to_end/cli_options/google/include_arg_types_and_defaults_true.txt +84 -0
  21. format_docstring-0.4.2/tests/test_data/end_to_end/cli_options/google/include_return_and_yield_types_false.txt +60 -0
  22. format_docstring-0.4.2/tests/test_data/end_to_end/cli_options/numpy/include_arg_defaults_false.txt +155 -0
  23. format_docstring-0.4.2/tests/test_data/end_to_end/cli_options/numpy/include_arg_types_and_defaults_false.txt +113 -0
  24. format_docstring-0.4.2/tests/test_data/end_to_end/cli_options/numpy/include_arg_types_and_defaults_true.txt +113 -0
  25. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/empty_lines_are_respected.txt +2 -2
  26. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/four_level_nested_classes.txt +3 -3
  27. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/indent_two_levels_8_spaces.txt +5 -5
  28. format_docstring-0.4.2/tests/test_data/end_to_end/google/inline_literal_is_not_split.txt +69 -0
  29. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/new_lines_before_and_after.txt +18 -20
  30. format_docstring-0.4.2/tests/test_data/end_to_end/google/opening_width_prefixes.txt +79 -0
  31. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/sections_notes_examples.txt +3 -3
  32. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/single_line_docstring.txt +4 -6
  33. format_docstring-0.4.2/tests/test_data/end_to_end/numpy/inline_literal_is_not_split.txt +77 -0
  34. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/google/after.ipynb +2 -2
  35. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/google/after.py +2 -2
  36. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/google/after_50.ipynb +2 -2
  37. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/google/after_50.py +2 -2
  38. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/empty_lines_are_respected.txt +2 -2
  39. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/fix_rst_backticks.txt +3 -2
  40. format_docstring-0.4.2/tests/test_data/line_wrap/google/inline_literal_is_not_split.txt +44 -0
  41. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/fix_rst_backticks.txt +2 -2
  42. format_docstring-0.4.2/tests/test_data/line_wrap/numpy/inline_literal_is_not_split.txt +41 -0
  43. format_docstring-0.4.2/tests/test_docstring_rewriter.py +974 -0
  44. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_google_fixture_inventory.py +5 -1
  45. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_line_wrap_google.py +66 -1
  46. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_line_wrap_numpy.py +73 -0
  47. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_line_wrap_utils.py +116 -0
  48. format_docstring-0.4.2/tests/test_main_jupyter.py +344 -0
  49. format_docstring-0.4.2/tests/test_main_py.py +286 -0
  50. {format_docstring-0.3.0 → format_docstring-0.4.2}/tox.ini +2 -2
  51. format_docstring-0.3.0/tests/test_docstring_rewriter.py +0 -479
  52. format_docstring-0.3.0/tests/test_main_jupyter.py +0 -111
  53. format_docstring-0.3.0/tests/test_main_py.py +0 -111
  54. {format_docstring-0.3.0 → format_docstring-0.4.2}/.github/workflows/python-package.yml +0 -0
  55. {format_docstring-0.3.0 → format_docstring-0.4.2}/.github/workflows/python-publish.yml +0 -0
  56. {format_docstring-0.3.0 → format_docstring-0.4.2}/.gitignore +0 -0
  57. {format_docstring-0.3.0 → format_docstring-0.4.2}/.pre-commit-hooks.yaml +0 -0
  58. {format_docstring-0.3.0 → format_docstring-0.4.2}/LICENSE +0 -0
  59. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/__init__.py +0 -0
  60. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/base_fixer.py +0 -0
  61. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring/section_utils.py +0 -0
  62. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring.egg-info/dependency_links.txt +0 -0
  63. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring.egg-info/entry_points.txt +0 -0
  64. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring.egg-info/requires.txt +0 -0
  65. {format_docstring-0.3.0 → format_docstring-0.4.2}/format_docstring.egg-info/top_level.txt +0 -0
  66. {format_docstring-0.3.0 → format_docstring-0.4.2}/requirements.dev +0 -0
  67. {format_docstring-0.3.0 → format_docstring-0.4.2}/setup.cfg +0 -0
  68. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/__init__.py +0 -0
  69. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/helpers.py +0 -0
  70. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_base_fixer.py +0 -0
  71. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/README.md +0 -0
  72. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/arg_name_is_default.txt +0 -0
  73. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/class_attribute_type_comment_defaults.txt +0 -0
  74. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/colon_spacing_fix.txt +0 -0
  75. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/contents_that_are_not_wrapped.txt +0 -0
  76. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/custom_section_after_args.txt +0 -0
  77. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/custom_section_after_doctest.txt +0 -0
  78. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/custom_section_before_args.txt +0 -0
  79. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/default_value_standardization.txt +0 -0
  80. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/doctest_output_lines_are_preserved.txt +0 -0
  81. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/examples_plain_code_after_doctest.txt +0 -0
  82. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/examples_section.txt +0 -0
  83. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/existing_linebreaks_should_not_be_respected.txt +0 -0
  84. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/fix_rst_backticks.txt +0 -0
  85. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/indent_four_levels_16_spaces_width_10.txt +0 -0
  86. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/indent_misaligned_all.txt +0 -0
  87. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/keyword_args_section.txt +0 -0
  88. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/line_length_2.txt +0 -0
  89. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/literal_block_backticks_are_preserved.txt +0 -0
  90. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/literal_block_blank_lines_backticks_are_preserved.txt +0 -0
  91. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/module_docstring_indent_zero_is_not_inferred.txt +0 -0
  92. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/module_level_docstring.txt +0 -0
  93. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/no_format_docstring_comment.txt +0 -0
  94. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/no_terminal_whitespace_only_line.txt +0 -0
  95. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/non_ascii_docstrings.txt +0 -0
  96. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/non_ascii_single_line_length_boundary.txt +0 -0
  97. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/param_signature_without_type.txt +0 -0
  98. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/parameters_returns_raises_wrapping.txt +0 -0
  99. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/plain_examples_code_is_preserved.txt +0 -0
  100. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/rST_cross_reference.txt +0 -0
  101. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/returns_bare_type_with_description_sync.txt +0 -0
  102. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/returns_colon_description_sync.txt +0 -0
  103. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/returns_description_without_type_sync.txt +0 -0
  104. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/returns_signature_and_description.txt +0 -0
  105. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/returns_yields_type_like_description_sync.txt +0 -0
  106. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/rst_code_block_backticks_are_preserved.txt +0 -0
  107. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/section_headings_with_colons.txt +0 -0
  108. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/section_title_fixed.txt +0 -0
  109. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/signature_dont_sync_raises.txt +0 -0
  110. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/signature_line_is_not_wrapped.txt +0 -0
  111. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/signature_sync_class_docstrings.txt +0 -0
  112. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/signature_sync_parameters.txt +0 -0
  113. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/signature_sync_returns.txt +0 -0
  114. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/signature_sync_yields.txt +0 -0
  115. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/single_line_backtick_expansion_respects_line_length.txt +0 -0
  116. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/texts_are_rewrapped.txt +0 -0
  117. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/tilde_code_fence_is_preserved.txt +0 -0
  118. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/variadic_signature_without_colon.txt +0 -0
  119. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/very_long_unbreakable_word.txt +0 -0
  120. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/google/yields_iterator_item_type_sync.txt +0 -0
  121. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/README.md +0 -0
  122. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/arg_name_is_default.txt +0 -0
  123. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/class_attribute_type_comment_defaults.txt +0 -0
  124. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/colon_spacing_fix.txt +0 -0
  125. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/contents_that_are_not_wrapped.txt +0 -0
  126. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/custom_section_after_args.txt +0 -0
  127. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/custom_section_after_doctest.txt +0 -0
  128. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/custom_section_before_args.txt +0 -0
  129. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/default_value_standardization.txt +0 -0
  130. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/doctest_output_lines_are_preserved.txt +0 -0
  131. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/empty_lines_are_respected.txt +0 -0
  132. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/examples_plain_code_after_doctest.txt +0 -0
  133. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/examples_section.txt +0 -0
  134. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/existing_linebreaks_should_not_be_respected.txt +0 -0
  135. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/fix_rst_backticks.txt +0 -0
  136. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/four_level_nested_classes.txt +0 -0
  137. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/indent_four_levels_16_spaces_width_10.txt +0 -0
  138. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/indent_misaligned_all.txt +0 -0
  139. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/indent_two_levels_8_spaces.txt +0 -0
  140. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/keyword_args_section.txt +0 -0
  141. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/line_length_2.txt +0 -0
  142. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/literal_block_backticks_are_preserved.txt +0 -0
  143. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/literal_block_blank_lines_backticks_are_preserved.txt +0 -0
  144. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/mismatched_underlines.txt +0 -0
  145. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/mismatched_underlines_one_dash.txt +0 -0
  146. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/mismatched_underlines_two_dashes.txt +0 -0
  147. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/module_docstring_indent_zero_is_not_inferred.txt +0 -0
  148. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/module_level_docstring.txt +0 -0
  149. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/new_lines_before_and_after.txt +0 -0
  150. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/no_format_docstring_comment.txt +0 -0
  151. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/no_terminal_whitespace_only_line.txt +0 -0
  152. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/non_ascii_docstrings.txt +0 -0
  153. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/non_ascii_single_line_length_boundary.txt +0 -0
  154. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/param_signature_without_type.txt +0 -0
  155. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/parameters_returns_raises_wrapping.txt +0 -0
  156. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/plain_examples_code_is_preserved.txt +0 -0
  157. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/rST_cross_reference.txt +0 -0
  158. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/returns_bare_type_with_description_sync.txt +0 -0
  159. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/returns_colon_description_sync.txt +0 -0
  160. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/returns_description_without_type_sync.txt +0 -0
  161. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/returns_signature_and_description.txt +0 -0
  162. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/returns_yields_type_like_description_sync.txt +0 -0
  163. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/rst_code_block_backticks_are_preserved.txt +0 -0
  164. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/section_headings_with_colons.txt +0 -0
  165. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/section_title_fixed.txt +0 -0
  166. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/sections_notes_examples.txt +0 -0
  167. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/signature_dont_sync_raises.txt +0 -0
  168. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/signature_line_is_not_wrapped.txt +0 -0
  169. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/signature_sync_class_docstrings.txt +0 -0
  170. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/signature_sync_parameters.txt +0 -0
  171. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/signature_sync_returns.txt +0 -0
  172. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/signature_sync_yields.txt +0 -0
  173. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/single_line_backtick_expansion_respects_line_length.txt +0 -0
  174. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/single_line_docstring.txt +0 -0
  175. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/texts_are_rewrapped.txt +0 -0
  176. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/tilde_code_fence_is_preserved.txt +0 -0
  177. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/variadic_signature_without_colon.txt +0 -0
  178. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/very_long_unbreakable_word.txt +0 -0
  179. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/end_to_end/numpy/yields_iterator_item_type_sync.txt +0 -0
  180. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/google/before.ipynb +0 -0
  181. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/google/before.py +0 -0
  182. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/numpy/after.ipynb +0 -0
  183. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/numpy/after.py +0 -0
  184. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/numpy/after_50.ipynb +0 -0
  185. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/numpy/after_50.py +0 -0
  186. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/numpy/before.ipynb +0 -0
  187. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/integration_test/numpy/before.py +0 -0
  188. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/jupyter/before.ipynb +0 -0
  189. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/jupyter/verbose_before.ipynb +0 -0
  190. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/README.md +0 -0
  191. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/arg_description_starts_with_bulleted_list.txt +0 -0
  192. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/arg_description_starts_with_table.txt +0 -0
  193. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/colon_spacing_fix.txt +0 -0
  194. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/contents_that_are_not_wrapped.txt +0 -0
  195. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/custom_section_after_args.txt +0 -0
  196. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/custom_section_after_doctest.txt +0 -0
  197. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/custom_section_before_args.txt +0 -0
  198. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/default_value_standardization.txt +0 -0
  199. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/doctest_output_backticks_are_preserved.txt +0 -0
  200. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/doctest_output_lines_are_preserved.txt +0 -0
  201. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/doctest_output_section_headers_are_preserved.txt +0 -0
  202. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/doctest_plain_output_is_preserved.txt +0 -0
  203. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/examples_leading_comment_is_preserved.txt +0 -0
  204. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/examples_plain_code_after_doctest.txt +0 -0
  205. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/examples_plain_output_after_code_is_preserved.txt +0 -0
  206. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/examples_section.txt +0 -0
  207. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/existing_linebreaks_should_not_be_respected.txt +0 -0
  208. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/fenced_code_backticks_are_preserved.txt +0 -0
  209. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/indent_four_levels_16_spaces_width_10.txt +0 -0
  210. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/indent_two_levels_8_spaces.txt +0 -0
  211. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/label_like_prose_in_notes.txt +0 -0
  212. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/line_length_2.txt +0 -0
  213. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/literal_block_backticks_are_preserved.txt +0 -0
  214. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/literal_block_blank_lines_backticks_are_preserved.txt +0 -0
  215. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/literal_block_marker_double_colon_preserved.txt +0 -0
  216. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/module_level_docstring.txt +0 -0
  217. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/no_terminal_whitespace_only_line.txt +0 -0
  218. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/non_ascii_docstrings.txt +0 -0
  219. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/param_signature_without_type.txt +0 -0
  220. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/parameters_returns_raises_wrapping.txt +0 -0
  221. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/plain_examples_code_is_preserved.txt +0 -0
  222. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/returns_signature_and_description.txt +0 -0
  223. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/rst_code_block_backticks_are_preserved.txt +0 -0
  224. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/section_headings_with_colons.txt +0 -0
  225. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/section_title_fixed.txt +0 -0
  226. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/sections_notes_examples.txt +0 -0
  227. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/signature_line_is_not_wrapped.txt +0 -0
  228. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/texts_are_rewrapped.txt +0 -0
  229. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/tilde_code_fence_is_preserved.txt +0 -0
  230. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/variadic_signature_without_colon.txt +0 -0
  231. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/google/very_long_unbreakable_word.txt +0 -0
  232. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/README.md +0 -0
  233. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/arg_description_starts_with_bulleted_list.txt +0 -0
  234. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/arg_description_starts_with_table.txt +0 -0
  235. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/colon_spacing_fix.txt +0 -0
  236. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/contents_that_are_not_wrapped.txt +0 -0
  237. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/custom_section_after_args.txt +0 -0
  238. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/custom_section_after_doctest.txt +0 -0
  239. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/custom_section_before_args.txt +0 -0
  240. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/default_value_standardization.txt +0 -0
  241. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/doctest_output_backticks_are_preserved.txt +0 -0
  242. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/doctest_output_lines_are_preserved.txt +0 -0
  243. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/doctest_output_section_headers_are_preserved.txt +0 -0
  244. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/doctest_plain_output_is_preserved.txt +0 -0
  245. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/empty_lines_are_respected.txt +0 -0
  246. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/examples_leading_comment_is_preserved.txt +0 -0
  247. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/examples_plain_code_after_doctest.txt +0 -0
  248. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/examples_plain_output_after_code_is_preserved.txt +0 -0
  249. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/examples_section.txt +0 -0
  250. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/existing_linebreaks_should_not_be_respected.txt +0 -0
  251. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/fenced_code_backticks_are_preserved.txt +0 -0
  252. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/indent_four_levels_16_spaces_width_10.txt +0 -0
  253. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/indent_two_levels_8_spaces.txt +0 -0
  254. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/label_like_prose_in_notes.txt +0 -0
  255. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/line_length_2.txt +0 -0
  256. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/literal_block_backticks_are_preserved.txt +0 -0
  257. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/literal_block_blank_lines_backticks_are_preserved.txt +0 -0
  258. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/literal_block_marker_double_colon_preserved.txt +0 -0
  259. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/mismatched_underlines.txt +0 -0
  260. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/mismatched_underlines_one_dash.txt +0 -0
  261. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/mismatched_underlines_two_dashes.txt +0 -0
  262. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/module_level_docstring.txt +0 -0
  263. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/no_terminal_whitespace_only_line.txt +0 -0
  264. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/non_ascii_docstrings.txt +0 -0
  265. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/param_signature_without_type.txt +0 -0
  266. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/parameters_returns_raises_wrapping.txt +0 -0
  267. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/plain_examples_code_is_preserved.txt +0 -0
  268. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/returns_signature_and_description.txt +0 -0
  269. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/rst_code_block_backticks_are_preserved.txt +0 -0
  270. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/section_headings_with_colons.txt +0 -0
  271. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/section_title_fixed.txt +0 -0
  272. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/sections_notes_examples.txt +0 -0
  273. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/signature_line_is_not_wrapped.txt +0 -0
  274. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/texts_are_rewrapped.txt +0 -0
  275. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/tilde_code_fence_is_preserved.txt +0 -0
  276. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/variadic_signature_without_colon.txt +0 -0
  277. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/line_wrap/numpy/very_long_unbreakable_word.txt +0 -0
  278. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_data/playground.py +0 -0
  279. {format_docstring-0.3.0 → format_docstring-0.4.2}/tests/test_playground.py +0 -0
@@ -17,7 +17,7 @@ repos:
17
17
  exclude: ^tests/helpers\.py$
18
18
  - id: check-merge-conflict
19
19
  - repo: https://github.com/jsh9/muff-pre-commit
20
- rev: 0.13.2
20
+ rev: 0.15.20
21
21
  hooks:
22
22
  - id: muff-format
23
23
  args: [--config, muff.toml]
@@ -27,11 +27,11 @@ repos:
27
27
  - id: blank-line-after-blocks
28
28
  - id: blank-line-after-blocks-jupyter
29
29
  - repo: https://github.com/lyz-code/yamlfix
30
- rev: 1.18.0
30
+ rev: 1.19.1
31
31
  hooks:
32
32
  - id: yamlfix
33
33
  - repo: https://github.com/pappasam/toml-sort
34
- rev: v0.24.2
34
+ rev: v0.24.4
35
35
  hooks:
36
36
  - id: toml-sort-fix
37
37
  args:
@@ -42,7 +42,7 @@ repos:
42
42
  - --trailing-comma-inline-array
43
43
  - --sort-inline-arrays
44
44
  - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
45
- rev: v2.15.0
45
+ rev: v2.16.0
46
46
  hooks:
47
47
  - id: pretty-format-ini
48
48
  args: [--autofix]
@@ -63,15 +63,28 @@ repos:
63
63
  - --no-sort-keys
64
64
  - --no-eof-newline
65
65
  - repo: https://github.com/jsh9/markdown-toc-creator
66
- rev: 0.1.0
66
+ rev: 0.1.3
67
67
  hooks:
68
68
  - id: markdown-toc-creator
69
69
  exclude: ^AGENTS\.md$|^CHANGELOG\.md$
70
70
  - repo: https://github.com/jsh9/markdown-heading-numbering
71
- rev: 0.1.0
71
+ rev: 0.1.1
72
72
  hooks:
73
73
  - id: markdown-heading-numbering
74
74
  exclude: ^CHANGELOG\.md$
75
+ - repo: https://github.com/jsh9/pre-commit-tox-version-sync
76
+ rev: 0.1.1
77
+ hooks:
78
+ - id: sync-precommit-tox-versions
79
+ args:
80
+ - --pre-commit-repo
81
+ - https://github.com/jsh9/muff-pre-commit
82
+ - --tox-env
83
+ - muff-lint
84
+ - --tox-env
85
+ - muff-format
86
+ - --tox-dep
87
+ - muff
75
88
  - repo: local
76
89
  hooks:
77
90
  - id: format-docstring
@@ -46,6 +46,13 @@ oriented before making changes.
46
46
  mirroring tuple element splits when the docstring already enumerates them.
47
47
  - `Raises` section entries are treated like signature lines in the NumPy
48
48
  wrapper so exception names stay untouched while descriptions wrap.
49
+ - Every prose wrapper goes through
50
+ `line_wrap_utils.wrap_keeping_inline_literals`, which masks every whitespace
51
+ character inside rST inline literals (``` ``...`` ```) with a private-use
52
+ placeholder so each literal wraps as one unbreakable word; breaking inside
53
+ one would drop significant spaces. `_find_google_signature_colon` likewise
54
+ skips colons inside inline literals so a literal at the start of a prose line
55
+ is not mistaken for a signature.
49
56
  - Wrapping honors NumPy section heuristics, rST constructs, code fences,
50
57
  `Examples` prompts, and literal blocks introduced by `::`.
51
58
  - `_normalize_signature_segment` flattens multiline annotations via
@@ -6,6 +6,51 @@ The format is based on
6
6
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
7
7
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [0.4.2] - 2026-10-04
10
+
11
+ - Fixed
12
+ - Line wrapping no longer breaks inside rST inline literals
13
+ (``` ``...`` ```). Breaking there dropped the whitespace at the break, so a
14
+ literal such as ``` ``' '`` ``` lost its spaces. Each inline literal now
15
+ wraps as one unbreakable word, overflowing like other long words when it is
16
+ longer than the line. Re-running the formatter rejoins literals that
17
+ earlier versions split across lines. Tabs and other Unicode whitespace
18
+ inside a literal are preserved as well, instead of being expanded or
19
+ collapsed.
20
+ - Google-style compact first lines no longer collapse runs of spaces inside
21
+ inline literals.
22
+ - Google-style prose lines that start with an inline literal containing a
23
+ colon (such as ``` ``key:value`` ```) are no longer mistaken for signature
24
+ lines, which rewrote the literal's content on a second pass.
25
+ - Full diff
26
+ - https://github.com/jsh9/format-docstring/compare/0.4.1...0.4.2
27
+
28
+ ## [0.4.1] - 2026-06-30
29
+
30
+ - Fixed
31
+ - Google-style compact docstring wrapping now reserves the opening literal
32
+ width from the source, so plain triple-quoted summaries keep the correct
33
+ first-line budget while raw and Unicode prefixes still account for their
34
+ extra prefix column.
35
+ - One-character quoted docstring literals and adjacent string-token
36
+ docstrings are skipped as unsupported formatter targets, so long strings
37
+ are not wrapped into invalid multi-line source.
38
+ - Full diff
39
+ - https://github.com/jsh9/format-docstring/compare/0.4.0...0.4.1
40
+
41
+ ## [0.4.0] - 2026-06-29
42
+
43
+ - Added
44
+ - CLI and `pyproject.toml` options to control whether argument types,
45
+ argument defaults, and Google return/yield types are included in docstring
46
+ signature lines for Python files and Jupyter notebooks.
47
+ - Fixed
48
+ - Google-style argument signature synchronization preserves existing
49
+ `required` metadata when source annotations replace stale docstring type
50
+ text.
51
+ - Full diff
52
+ - https://github.com/jsh9/format-docstring/compare/0.3.0...0.4.0
53
+
9
54
  ## [0.3.0] - 2026-06-19
10
55
 
11
56
  - Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: format-docstring
3
- Version: 0.3.0
3
+ Version: 0.4.2
4
4
  Summary: A Python formatter to wrap/adjust docstring lines
5
5
  Author-email: jsh9 <25124332+jsh9@users.noreply.github.com>
6
6
  Maintainer-email: jsh9 <25124332+jsh9@users.noreply.github.com>
@@ -53,6 +53,7 @@ ______________________________________________________________________
53
53
  - [5.1. Command Line Interface](#51-command-line-interface)
54
54
  - [5.2. Pre-commit Hook](#52-pre-commit-hook)
55
55
  - [5.3. Opting Out of Formatting](#53-opting-out-of-formatting)
56
+ - [5.4. What Counts as a Docstring](#54-what-counts-as-a-docstring)
56
57
  - [6. Configuration](#6-configuration)
57
58
  - [6.1. Command-Line Options](#61-command-line-options)
58
59
  - [6.2. Usage Examples](#62-usage-examples)
@@ -68,18 +69,17 @@ ______________________________________________________________________
68
69
  `format-docstring` is a tool that automatically formats and wraps docstring
69
70
  content in Python files and Jupyter notebooks.
70
71
 
71
- Baseline reflow corresponds to the common docstring cleanups offered by
72
- general-purpose formatters: splitting one-line docstrings into the canonical
73
- multi-line layout (triple quotes, blank line, summary), normalizing
74
- indentation, and wrapping text at a fixed column width without applying extra
75
- heuristics.
76
-
77
72
  | Feature | `format-docstring` | [docformatter] | [pydocstringformatter] | [Ruff] | [Black] |
78
73
  | ----------------------------------------- | ------------------ | -------------- | ---------------------- | ------ | ------- |
79
74
  | Docstring wrapping | ✅ | ❌ | ❌ | ❌ | ❌ |
80
75
  | Compatible with line length linter (E501) | ✅ | ❌ | ❌ | N/A | N/A |
81
76
  | Fixes common docstring typos | ✅ | ❌ | ❌ | ❌ | ❌ |
82
77
 
78
+ For stronger docstring checks, use `format-docstring` together with
79
+ [`pydoclint`](https://github.com/jsh9/pydoclint). `format-docstring` handles
80
+ formatting and wrapping, while `pydoclint` checks docstring completeness and
81
+ consistency with function signatures.
82
+
83
83
  ## 2. Before vs After Examples
84
84
 
85
85
  These examples show the same kinds of cleanup in the two supported docstring
@@ -328,6 +328,20 @@ records : list[dict[str, str]]
328
328
  """
329
329
  ```
330
330
 
331
+ **Inline literals are never split.** Each ``` ``...`` ``` span wraps as one
332
+ word, so spaces, tabs and other whitespace inside it are kept and the literal
333
+ stays greppable. A literal longer than the line overflows instead of breaking.
334
+
335
+ ```diff
336
+ """
337
+ Render a report as text.
338
+
339
+ -By default, all the nested lines in the generated report are indented with ``' '`` (two spaces) before they are written.
340
+ +By default, all the nested lines in the generated report are indented with
341
+ +``' '`` (two spaces) before they are written.
342
+ """
343
+ ```
344
+
331
345
  **Known sections are parsed, and custom sections are kept.** Recognized section
332
346
  titles such as `Parameters`, `Returns`, `Yields`, `Raises`, `Examples`, and
333
347
  `Notes` are canonicalized. Unknown underlined sections remain custom sections,
@@ -421,6 +435,20 @@ Args:
421
435
  """
422
436
  ```
423
437
 
438
+ **Inline literals are never split.** Each ``` ``...`` ``` span wraps as one
439
+ word, so spaces, tabs and other whitespace inside it are kept and the literal
440
+ stays greppable. A literal longer than the line overflows instead of breaking.
441
+
442
+ ```diff
443
+ """
444
+ Render a report as text.
445
+
446
+ -By default, all the nested lines in the generated report are indented with ``' '`` (two spaces) before they are written.
447
+ +By default, all the nested lines in the generated report are indented with
448
+ +``' '`` (two spaces) before they are written.
449
+ """
450
+ ```
451
+
424
452
  **Custom section boundaries are indentation-sensitive.** Known headers such as
425
453
  `Args:`, `Returns:`, `Raises:`, and `Examples:` are canonicalized. Unknown
426
454
  peer-level headers after summary content are treated as custom sections, so
@@ -563,26 +591,53 @@ first run `format-docstring`, accept the parts you like, revert the edits you
563
591
  dislike, and then add an inline `# no-format-docstring` comment so future runs
564
592
  leave that docstring untouched.
565
593
 
594
+ ### 5.4. What Counts as a Docstring
595
+
596
+ `format-docstring` follows [Python's docstring rule][python-docstring] to find
597
+ candidate docstrings: the first statement in a module, class, function, or
598
+ method must be a string literal. It intentionally formats only one
599
+ triple-quoted string token with a plain, raw, or Unicode prefix:
600
+
601
+ ```python
602
+ """Formatted."""
603
+ r"""Formatted."""
604
+ u"""Formatted."""
605
+ ```
606
+
607
+ Single-quoted and double-quoted one-character delimiters can be Python
608
+ docstrings, but they are outside formatter support and are left unchanged.
609
+ Adjacent or implicitly concatenated string literals, formatted string literals,
610
+ and bytes literals are also left unchanged:
611
+
612
+ ```python
613
+ 'Not formatted.'
614
+ "Not formatted."
615
+ """Not formatted.""" "Still not formatted."
616
+ f"""Not a docstring."""
617
+ rf"""Not a docstring."""
618
+ fr"""Not a docstring."""
619
+ b"""Not a docstring."""
620
+ rb"""Not a docstring."""
621
+ br"""Not a docstring."""
622
+ ```
623
+
566
624
  ## 6. Configuration
567
625
 
568
626
  ### 6.1. Command-Line Options
569
627
 
570
- - `--line-length INTEGER`: Maximum line length for wrapping docstrings
571
- (default: 79)
572
- - `--docstring-style CHOICE`: Docstring style to target (`numpy` or `google`,
573
- default: `numpy`). This selects the style to format, not a converter between
574
- styles.
575
- - `--fix-rst-backticks BOOL`: Automatically fix single backticks to double
576
- backticks per rST syntax (default: `True`). Pass `False` to disable this.
577
- - `--verbose CHOICE`: Logging detail level (`default` keeps the existing
578
- behaviour, `diff` prints unified diffs when rewrites happen)
579
- - `--exclude TEXT`: Regex pattern to exclude files/directories (default:
580
- `\.git|\.tox|\.pytest_cache`)
581
- - `--config PATH`: Path to a `pyproject.toml` config file. If not specified,
582
- the tool automatically searches for `pyproject.toml` in parent directories.
583
- Command-line options take precedence over config file settings.
584
- - `--version`: Show version information
585
- - `--help`: Show help message
628
+ | Option | Default | Description |
629
+ | --------------------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
630
+ | `--line-length INTEGER` | `79` | Maximum line length for wrapping docstrings. |
631
+ | `--docstring-style CHOICE` | `numpy` | Docstring style to target, either `numpy` or `google`. This selects the style to format, not a converter between styles. |
632
+ | `--fix-rst-backticks BOOL` | `True` | Automatically fix single backticks to double backticks per rST syntax. Pass `False` to disable this. |
633
+ | `--include-arg-types BOOL` | `True` | Include argument type hints in parameter docstrings. Pass `False` to remove them from structured arg and attribute signature lines; defaults must also be disabled. |
634
+ | `--include-arg-defaults BOOL` | `True` | Include argument defaults in parameter docstrings. Pass `False` to remove explicit defaults and `optional` markers from structured arg and attribute signature lines. Requires argument types. |
635
+ | `--include-return-and-yield-types BOOL` | `True` | Include type hints in `Returns` and `Yields` docstrings. Pass `False` to remove them from Google-style return/yield descriptions. NumPy style does not allow `False`. |
636
+ | `--verbose CHOICE` | `default` | Logging detail level. `default` keeps the existing behaviour; `diff` prints unified diffs when rewrites happen. |
637
+ | `--exclude TEXT` | `\.git\|\.tox\|\.pytest_cache` | Regex pattern to exclude files/directories. |
638
+ | `--config PATH` | None | Path to a `pyproject.toml` config file. If not specified, the tool automatically searches for `pyproject.toml` in parent directories. Command-line options take precedence over config file settings. |
639
+ | `--version` | N/A | Show version information. |
640
+ | `--help` | N/A | Show help message. |
586
641
 
587
642
  ### 6.2. Usage Examples
588
643
 
@@ -613,6 +668,12 @@ format-docstring --config pyproject.toml --line-length 100 src/
613
668
 
614
669
  # Disable backtick fixing
615
670
  format-docstring --fix-rst-backticks=False my_module.py
671
+
672
+ # Omit argument defaults, including optional markers
673
+ format-docstring --include-arg-defaults=False src/
674
+
675
+ # Omit Google-style return/yield type text when annotations carry the types
676
+ format-docstring --docstring-style google --include-return-and-yield-types=False src/
616
677
  ```
617
678
 
618
679
  ### 6.3. `pyproject.toml` Configuration
@@ -627,17 +688,24 @@ as `line-length`.
627
688
  line_length = 79
628
689
  docstring_style = "numpy"
629
690
  fix_rst_backticks = true
691
+ include_arg_types = true
692
+ include_arg_defaults = true
693
+ include_return_and_yield_types = true
630
694
  exclude = "\\.git|\\.venv|__pycache__"
631
695
  verbose = "default" # or "diff" to print unified diffs
632
696
  ```
633
697
 
634
- For Google-style docstrings:
698
+ For Google-style docstrings that omit argument types/defaults and return/yield
699
+ types:
635
700
 
636
701
  ```toml
637
702
  [tool.format_docstring]
638
703
  docstring_style = "google"
639
704
  line_length = 79
640
705
  fix_rst_backticks = true
706
+ include_arg_types = false
707
+ include_arg_defaults = false
708
+ include_return_and_yield_types = false
641
709
  ```
642
710
 
643
711
  **Available options:**
@@ -648,6 +716,19 @@ fix_rst_backticks = true
648
716
  `"numpy"` or `"google"`. Default: `"numpy"`.
649
717
  - `fix_rst_backticks` / `fix-rst-backticks` (bool): whether to convert single
650
718
  backticks in prose to double backticks per rST syntax. Default: `true`.
719
+ - `include_arg_types` / `include-arg-types` (bool): whether to include argument
720
+ type hints in parameter docstrings. Default: `true`. If this is `false`,
721
+ `include_arg_defaults` must also be `false`.
722
+ - `include_arg_defaults` / `include-arg-defaults` (bool): whether to include
723
+ argument defaults in parameter docstrings. Default: `true`. This requires
724
+ `include_arg_types = true`. When set to `false`, explicit defaults and
725
+ `optional` markers are removed from structured signatures, including compact
726
+ or extra-spaced forms such as `,optional` and `, optional`. For example,
727
+ `x : int, optional` becomes `x : int` and `x (int, optional):` becomes
728
+ `x (int):`.
729
+ - `include_return_and_yield_types` / `include-return-and-yield-types` (bool):
730
+ whether to include return and yield type hints in docstrings. Default:
731
+ `true`. Setting this to `false` is supported only with Google style.
651
732
  - `exclude` (str): regex pattern used to skip files or directories. Default:
652
733
  `"\\.git|\\.tox|\\.pytest_cache"`.
653
734
  - `verbose` (str): logging detail level, either `"default"` or `"diff"`. Use
@@ -668,4 +749,5 @@ use AI coding assistants to rewrite the docstrings first.
668
749
  [black]: https://github.com/psf/black
669
750
  [docformatter]: https://github.com/PyCQA/docformatter
670
751
  [pydocstringformatter]: https://github.com/DanielNoord/pydocstringformatter
752
+ [python-docstring]: https://docs.python.org/3/glossary.html#term-docstring
671
753
  [ruff]: https://github.com/astral-sh/ruff
@@ -21,6 +21,7 @@ ______________________________________________________________________
21
21
  - [5.1. Command Line Interface](#51-command-line-interface)
22
22
  - [5.2. Pre-commit Hook](#52-pre-commit-hook)
23
23
  - [5.3. Opting Out of Formatting](#53-opting-out-of-formatting)
24
+ - [5.4. What Counts as a Docstring](#54-what-counts-as-a-docstring)
24
25
  - [6. Configuration](#6-configuration)
25
26
  - [6.1. Command-Line Options](#61-command-line-options)
26
27
  - [6.2. Usage Examples](#62-usage-examples)
@@ -36,18 +37,17 @@ ______________________________________________________________________
36
37
  `format-docstring` is a tool that automatically formats and wraps docstring
37
38
  content in Python files and Jupyter notebooks.
38
39
 
39
- Baseline reflow corresponds to the common docstring cleanups offered by
40
- general-purpose formatters: splitting one-line docstrings into the canonical
41
- multi-line layout (triple quotes, blank line, summary), normalizing
42
- indentation, and wrapping text at a fixed column width without applying extra
43
- heuristics.
44
-
45
40
  | Feature | `format-docstring` | [docformatter] | [pydocstringformatter] | [Ruff] | [Black] |
46
41
  | ----------------------------------------- | ------------------ | -------------- | ---------------------- | ------ | ------- |
47
42
  | Docstring wrapping | ✅ | ❌ | ❌ | ❌ | ❌ |
48
43
  | Compatible with line length linter (E501) | ✅ | ❌ | ❌ | N/A | N/A |
49
44
  | Fixes common docstring typos | ✅ | ❌ | ❌ | ❌ | ❌ |
50
45
 
46
+ For stronger docstring checks, use `format-docstring` together with
47
+ [`pydoclint`](https://github.com/jsh9/pydoclint). `format-docstring` handles
48
+ formatting and wrapping, while `pydoclint` checks docstring completeness and
49
+ consistency with function signatures.
50
+
51
51
  ## 2. Before vs After Examples
52
52
 
53
53
  These examples show the same kinds of cleanup in the two supported docstring
@@ -296,6 +296,20 @@ records : list[dict[str, str]]
296
296
  """
297
297
  ```
298
298
 
299
+ **Inline literals are never split.** Each ``` ``...`` ``` span wraps as one
300
+ word, so spaces, tabs and other whitespace inside it are kept and the literal
301
+ stays greppable. A literal longer than the line overflows instead of breaking.
302
+
303
+ ```diff
304
+ """
305
+ Render a report as text.
306
+
307
+ -By default, all the nested lines in the generated report are indented with ``' '`` (two spaces) before they are written.
308
+ +By default, all the nested lines in the generated report are indented with
309
+ +``' '`` (two spaces) before they are written.
310
+ """
311
+ ```
312
+
299
313
  **Known sections are parsed, and custom sections are kept.** Recognized section
300
314
  titles such as `Parameters`, `Returns`, `Yields`, `Raises`, `Examples`, and
301
315
  `Notes` are canonicalized. Unknown underlined sections remain custom sections,
@@ -389,6 +403,20 @@ Args:
389
403
  """
390
404
  ```
391
405
 
406
+ **Inline literals are never split.** Each ``` ``...`` ``` span wraps as one
407
+ word, so spaces, tabs and other whitespace inside it are kept and the literal
408
+ stays greppable. A literal longer than the line overflows instead of breaking.
409
+
410
+ ```diff
411
+ """
412
+ Render a report as text.
413
+
414
+ -By default, all the nested lines in the generated report are indented with ``' '`` (two spaces) before they are written.
415
+ +By default, all the nested lines in the generated report are indented with
416
+ +``' '`` (two spaces) before they are written.
417
+ """
418
+ ```
419
+
392
420
  **Custom section boundaries are indentation-sensitive.** Known headers such as
393
421
  `Args:`, `Returns:`, `Raises:`, and `Examples:` are canonicalized. Unknown
394
422
  peer-level headers after summary content are treated as custom sections, so
@@ -531,26 +559,53 @@ first run `format-docstring`, accept the parts you like, revert the edits you
531
559
  dislike, and then add an inline `# no-format-docstring` comment so future runs
532
560
  leave that docstring untouched.
533
561
 
562
+ ### 5.4. What Counts as a Docstring
563
+
564
+ `format-docstring` follows [Python's docstring rule][python-docstring] to find
565
+ candidate docstrings: the first statement in a module, class, function, or
566
+ method must be a string literal. It intentionally formats only one
567
+ triple-quoted string token with a plain, raw, or Unicode prefix:
568
+
569
+ ```python
570
+ """Formatted."""
571
+ r"""Formatted."""
572
+ u"""Formatted."""
573
+ ```
574
+
575
+ Single-quoted and double-quoted one-character delimiters can be Python
576
+ docstrings, but they are outside formatter support and are left unchanged.
577
+ Adjacent or implicitly concatenated string literals, formatted string literals,
578
+ and bytes literals are also left unchanged:
579
+
580
+ ```python
581
+ 'Not formatted.'
582
+ "Not formatted."
583
+ """Not formatted.""" "Still not formatted."
584
+ f"""Not a docstring."""
585
+ rf"""Not a docstring."""
586
+ fr"""Not a docstring."""
587
+ b"""Not a docstring."""
588
+ rb"""Not a docstring."""
589
+ br"""Not a docstring."""
590
+ ```
591
+
534
592
  ## 6. Configuration
535
593
 
536
594
  ### 6.1. Command-Line Options
537
595
 
538
- - `--line-length INTEGER`: Maximum line length for wrapping docstrings
539
- (default: 79)
540
- - `--docstring-style CHOICE`: Docstring style to target (`numpy` or `google`,
541
- default: `numpy`). This selects the style to format, not a converter between
542
- styles.
543
- - `--fix-rst-backticks BOOL`: Automatically fix single backticks to double
544
- backticks per rST syntax (default: `True`). Pass `False` to disable this.
545
- - `--verbose CHOICE`: Logging detail level (`default` keeps the existing
546
- behaviour, `diff` prints unified diffs when rewrites happen)
547
- - `--exclude TEXT`: Regex pattern to exclude files/directories (default:
548
- `\.git|\.tox|\.pytest_cache`)
549
- - `--config PATH`: Path to a `pyproject.toml` config file. If not specified,
550
- the tool automatically searches for `pyproject.toml` in parent directories.
551
- Command-line options take precedence over config file settings.
552
- - `--version`: Show version information
553
- - `--help`: Show help message
596
+ | Option | Default | Description |
597
+ | --------------------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
598
+ | `--line-length INTEGER` | `79` | Maximum line length for wrapping docstrings. |
599
+ | `--docstring-style CHOICE` | `numpy` | Docstring style to target, either `numpy` or `google`. This selects the style to format, not a converter between styles. |
600
+ | `--fix-rst-backticks BOOL` | `True` | Automatically fix single backticks to double backticks per rST syntax. Pass `False` to disable this. |
601
+ | `--include-arg-types BOOL` | `True` | Include argument type hints in parameter docstrings. Pass `False` to remove them from structured arg and attribute signature lines; defaults must also be disabled. |
602
+ | `--include-arg-defaults BOOL` | `True` | Include argument defaults in parameter docstrings. Pass `False` to remove explicit defaults and `optional` markers from structured arg and attribute signature lines. Requires argument types. |
603
+ | `--include-return-and-yield-types BOOL` | `True` | Include type hints in `Returns` and `Yields` docstrings. Pass `False` to remove them from Google-style return/yield descriptions. NumPy style does not allow `False`. |
604
+ | `--verbose CHOICE` | `default` | Logging detail level. `default` keeps the existing behaviour; `diff` prints unified diffs when rewrites happen. |
605
+ | `--exclude TEXT` | `\.git\|\.tox\|\.pytest_cache` | Regex pattern to exclude files/directories. |
606
+ | `--config PATH` | None | Path to a `pyproject.toml` config file. If not specified, the tool automatically searches for `pyproject.toml` in parent directories. Command-line options take precedence over config file settings. |
607
+ | `--version` | N/A | Show version information. |
608
+ | `--help` | N/A | Show help message. |
554
609
 
555
610
  ### 6.2. Usage Examples
556
611
 
@@ -581,6 +636,12 @@ format-docstring --config pyproject.toml --line-length 100 src/
581
636
 
582
637
  # Disable backtick fixing
583
638
  format-docstring --fix-rst-backticks=False my_module.py
639
+
640
+ # Omit argument defaults, including optional markers
641
+ format-docstring --include-arg-defaults=False src/
642
+
643
+ # Omit Google-style return/yield type text when annotations carry the types
644
+ format-docstring --docstring-style google --include-return-and-yield-types=False src/
584
645
  ```
585
646
 
586
647
  ### 6.3. `pyproject.toml` Configuration
@@ -595,17 +656,24 @@ as `line-length`.
595
656
  line_length = 79
596
657
  docstring_style = "numpy"
597
658
  fix_rst_backticks = true
659
+ include_arg_types = true
660
+ include_arg_defaults = true
661
+ include_return_and_yield_types = true
598
662
  exclude = "\\.git|\\.venv|__pycache__"
599
663
  verbose = "default" # or "diff" to print unified diffs
600
664
  ```
601
665
 
602
- For Google-style docstrings:
666
+ For Google-style docstrings that omit argument types/defaults and return/yield
667
+ types:
603
668
 
604
669
  ```toml
605
670
  [tool.format_docstring]
606
671
  docstring_style = "google"
607
672
  line_length = 79
608
673
  fix_rst_backticks = true
674
+ include_arg_types = false
675
+ include_arg_defaults = false
676
+ include_return_and_yield_types = false
609
677
  ```
610
678
 
611
679
  **Available options:**
@@ -616,6 +684,19 @@ fix_rst_backticks = true
616
684
  `"numpy"` or `"google"`. Default: `"numpy"`.
617
685
  - `fix_rst_backticks` / `fix-rst-backticks` (bool): whether to convert single
618
686
  backticks in prose to double backticks per rST syntax. Default: `true`.
687
+ - `include_arg_types` / `include-arg-types` (bool): whether to include argument
688
+ type hints in parameter docstrings. Default: `true`. If this is `false`,
689
+ `include_arg_defaults` must also be `false`.
690
+ - `include_arg_defaults` / `include-arg-defaults` (bool): whether to include
691
+ argument defaults in parameter docstrings. Default: `true`. This requires
692
+ `include_arg_types = true`. When set to `false`, explicit defaults and
693
+ `optional` markers are removed from structured signatures, including compact
694
+ or extra-spaced forms such as `,optional` and `, optional`. For example,
695
+ `x : int, optional` becomes `x : int` and `x (int, optional):` becomes
696
+ `x (int):`.
697
+ - `include_return_and_yield_types` / `include-return-and-yield-types` (bool):
698
+ whether to include return and yield type hints in docstrings. Default:
699
+ `true`. Setting this to `false` is supported only with Google style.
619
700
  - `exclude` (str): regex pattern used to skip files or directories. Default:
620
701
  `"\\.git|\\.tox|\\.pytest_cache"`.
621
702
  - `verbose` (str): logging detail level, either `"default"` or `"diff"`. Use
@@ -636,4 +717,5 @@ use AI coding assistants to rewrite the docstrings first.
636
717
  [black]: https://github.com/psf/black
637
718
  [docformatter]: https://github.com/PyCQA/docformatter
638
719
  [pydocstringformatter]: https://github.com/DanielNoord/pydocstringformatter
720
+ [python-docstring]: https://docs.python.org/3/glossary.html#term-docstring
639
721
  [ruff]: https://github.com/astral-sh/ruff