v1.11.0 - Flexible Section Ordering and Multi-word Headers
π Overview
Introduce support for unordered docstring sections and multi-word section headers to provide greater flexibility in docstring formatting. This release also includes bug fixes for section name validation and improvements to the test suite.
β¨ New Features
π Support Unordered Sections
Allow sections to be defined with order = null in the configuration. These sections can appear anywhere within a docstring without triggering sequence validation errors. This is particularly useful for sections like Deprecation Warning or Note that may appear at different positions depending on the context.
π Support Multi-word Section Headers
Update the section detection logic to support headers containing multiple words. This enables the use of descriptive section names such as Custom List or Deprecation Warning while maintaining strict validation of other rules like colon usage and title casing.
π Bug Fixes
π Fix Multi-word Section Validation
Resolve an issue where multi-word section names were incorrectly triggering "requires parenthesized types" errors. The validation regex now correctly handles spaces within section headers.
π οΈ Fix Test Suite Syntax Error
Correct a SyntaxError in the test helper _check_docstring() caused by improper indentation of generated Python content.
βοΈ Technical Improvements
π§ͺ Expand Test Coverage
Add a comprehensive suite of tests for unordered sections, covering various placements, case-insensitivity, and interaction with required sections. Maintain 100% code coverage across the entire project.
π Update Documentation
Update the README.md to include details and examples for the new flexible section ordering feature.
πͺ Pull Requests
Full Changelog: v1.10.1...v1.11.0