Skip to content

Align ultralytics-dev docstring formatter with upstream - #104

Merged
fcakyon merged 1 commit into
mainfrom
feature/upstream-docstring-formatter
Feb 5, 2026
Merged

Align ultralytics-dev docstring formatter with upstream#104
fcakyon merged 1 commit into
mainfrom
feature/upstream-docstring-formatter

Conversation

@fcakyon

@fcakyon fcakyon commented Feb 5, 2026

Copy link
Copy Markdown
Owner

Adopt the full-featured docstring formatting engine from ultralytics/actions, replacing the simplified ad-hoc implementation in the ultralytics-dev plugin.

  • Fix bug where blank lines after the summary line were incorrectly removed
  • Add word wrapping at 120 chars with orphan control via wrap_words and wrap_hanging
  • Preserve lists, code fences, tables, ASCII trees, and indented blocks via emit_paragraphs
  • Replace ad-hoc line-by-line processing with section-based parsing (parse_sections and format_google)
  • Add detect_opener for proper quote style and prefix handling
  • Add preserve_trailing_newlines to keep original file endings
  • Add format_structured_block for Args/Returns sections with hanging indent
  • Bump ultralytics-dev version from 2.1.0 to 2.1.1
  • format_python_file signature remains backward-compatible with markdown_formatting.py

Adopt the full-featured formatting engine from ultralytics/actions:
- Fix bug where blank lines after summary were removed
- Add word wrapping at 120 chars with orphan control
- Preserve lists, code fences, tables, ASCII trees, indented blocks
- Section-based parsing (parse_sections/format_google) replaces ad-hoc logic
- detect_opener for proper quote/prefix handling
- preserve_trailing_newlines to keep original file endings
- format_structured_block for Args/Returns with hanging indent
- Bump ultralytics-dev version to 2.1.1
@fcakyon fcakyon self-assigned this Feb 5, 2026
@fcakyon
fcakyon merged commit 27575ec into main Feb 5, 2026
1 check passed
@fcakyon
fcakyon deleted the feature/upstream-docstring-formatter branch February 5, 2026 15:52
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