Skip to content

pyformatter v0.1.0 - Initial Release

Choose a tag to compare

@RikGhosh487 RikGhosh487 released this 31 Jul 17:09
· 18 commits to main since this release

[0.1.0] - 2025-01-31

Added

  • pydocfmt: Command-line tool for formatting Python docstrings

    • Google-style docstring formatting support
    • Intelligent line wrapping for docstring sections (Args, Returns, Raises, Examples, etc.)
    • Preservation of code blocks in Examples sections with automatic fencing
    • Support for parameter descriptions with type annotations
    • Proper handling of multi-paragraph descriptions and lists
    • Configuration via pyproject.toml and command-line arguments
  • pycommentfmt: Command-line tool for formatting Python comments

    • Automatic comment line wrapping based on configurable line length
    • Intelligent handling of inline comments vs. block comments
    • Preservation of special comments (noqa, type: ignore, pylint directives, etc.)
    • Smart spacing correction for inline comments
    • Preservation of code-style comment blocks
    • Long inline comment extraction to separate comment blocks
  • Core Infrastructure:

    • Configurable line length (default: 88 characters)
    • Include/exclude file patterns with regex support
    • Check mode for CI/CD integration (non-destructive validation)
    • Recursive directory processing
    • TOML configuration support via pyproject.tool.<formatter>
  • CLI Features:

    • --check flag for validation without modification
    • --line-length for custom line length configuration
    • --include and --exclude for file filtering
    • Exit code 1 when formatting issues are detected in check mode
  • Google-style Docstring Support:

    • Args/Arguments section formatting with type annotations
    • Returns/Return section formatting
    • Raises/Raise section formatting with exception backticks
    • Yields/Yield section formatting
    • Examples section with automatic code block fencing
    • Attributes section formatting
    • Intelligent paragraph and list handling in descriptions
  • Comment Formatting Features:

    • Block comment rewrapping with proper indentation preservation
    • Inline comment spacing standardization
    • Long inline comment extraction and placement above code
    • Special comment preservation (tool directives, pragmas, etc.)
    • Code comment block detection and preservation
  • Testing & Quality Assurance:

    • Comprehensive test suite with 100% coverage for core functionality
    • Unit tests for both docstring and comment formatting
    • Edge case handling for malformed docstrings and comments
    • Test coverage for check mode and file modification detection
  • Developer Experience:

    • Pre-commit hook configuration
    • Pre-commit hooks for external repositories (.pre-commit-hooks.yaml)
    • GitHub Actions CI/CD workflows
    • Black and isort integration
    • Development environment configuration
  • Documentation:

    • Comprehensive README with usage examples
    • Configuration documentation
    • Before/after formatting examples
    • Integration guides for popular tools