Skip to content

v1.11.1 - Static Type Checking and Robust Sorting

Choose a tag to compare

@chrimaho chrimaho released this 04 Jan 23:21
· 112 commits to main since this release

πŸ“ƒ 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 pyright to the dev dependency group in pyproject.toml.
  • Implement the check_pyright() function in src/utils/scripts.py to 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 in config.py to handle None values for section orders by defaulting to float("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 the DocstringChecker() 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_node is an instance of the ast.FunctionDef() or ast.AsyncFunctionDef() class in various test cases.
  • Update the TestParameterMismatch() class to verify that docstring and error_message are not None before 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 in scripts.py to execute check_mkdocs() after check_build(), ensuring that the documentation build is verified after the package build.
  • Update the .gitignore file to include the .complexipy_cache/* pattern, preventing local cache artefacts from being tracked.

πŸ’ͺ Pull Requests

  • Integrate Pyright and Refine Section Sorting Logic by @chrimaho in #36

Full Changelog: v1.11.0...v1.11.1