v1.11.1 - Static Type Checking and Robust Sorting
π Overview
Introduce static type checking with Pyright and refine the section sorting logic to improve the robustness and reliability of the docstring validation process. This release also enhances the test suite with more explicit assertions and optimises the development workflow.
β¨ New Features
π Integrate Pyright Static Analysis
Integrate pyright into the development workflow to ensure strict type safety across the codebase.
- Add
pyrightto thedevdependency group inpyproject.toml. - Implement the
check_pyright()function insrc/utils/scripts.pyto perform automated static analysis. - Update the
check()function to include Pyright validation as a standard step in the project's quality assurance process.
π Bug Fixes
βοΈ Refine Section Sorting Logic
Improve the robustness of the section sorting mechanism when handling optional order values.
- Update the
_parse_sections_config()function inconfig.pyto handleNonevalues for section orders by defaulting tofloat("inf"). This ensures that unordered sections are consistently placed at the end of the sequence. - Standardise the sorting logic within the
._build_section_patterns()and._build_expected_section_order()methods in theDocstringChecker()class to handle optional orders gracefully.
βοΈ Technical Improvements
π§ͺ Enhance Test Assertions
Strengthen the test suite by introducing more explicit assertions and type validations.
- Add assertions to verify that
func_nodeis an instance of theast.FunctionDef()orast.AsyncFunctionDef()class in various test cases. - Update the
TestParameterMismatch()class to verify thatdocstringanderror_messageare notNonebefore performing string operations, resolving potential type errors and improving test reliability.
π§Ή Optimise Validation Workflow
Refine the project's validation script and repository maintenance.
- Reorder the
check()function inscripts.pyto executecheck_mkdocs()aftercheck_build(), ensuring that the documentation build is verified after the package build. - Update the
.gitignorefile to include the.complexipy_cache/*pattern, preventing local cache artefacts from being tracked.
πͺ Pull Requests
Full Changelog: v1.11.0...v1.11.1