✨ Enhancements
- Can now create control flow graphs using `python_ta.control_flow_graphs` to visualize the
execution paths of Python code.
- `forbidden-top-level-code` and `forbidden-global-variables` now allow top-level type alias
assignment statements.
- The `trailing-whitespace` error message now highlights the trailing whitespace.
- The `unnecessary-indexing` error now checks for a greater variety of loop/comprehension indexes.
- Provided configuration files are now merged with PythonTA defaults, so you now only
need to specify options that you want to be overridden. To ignore PythonTA defaults (the
old behaviour), pass `load_default_config=False` to `check_errors` and `check_all`.
- Improved the code snippets for the `pep8-errors` "blank line" messages.
Extra blank lines are now highlighted, and suggestions are added when blank lines are missing.
- The default value of the `pyta-number-of-messages` configuration option is now 0 (changed from 5).
This causes all error occurrences to be displayed.
- Improved efficiency of the contract-checking custom `setattr` for classes.
- Added new function `python_ta.contracts.validate_invariants` to manually check contracts
for an object.
- Updated to [pycodestyle v2.11](https://github.com/PyCQA/pycodestyle/blob/main/CHANGES.txt).
🐛 Bug fixes
- Fixed bug where running `python3 -m python_ta --generate-config` yields a `FileNotFoundError`.
- Fixed bug in how PythonTA reports error messages that occur when parsing configuration files.
- Ensured some config file parsing errors no longer display incorrect lines in the error report.
- Fixed bug where the `HTMLReporter` and `JSONReporter` would ignore the `pyta-number-of-messages`
option and always display all error occurrences.
- Fixed bug in `check_contracts` where imported classes were not correctly resolved when checking
types.
- Fixed bug for class contract-checking when assigning an instance attribute that violates a class
type constraint or representation invariant. Previously, the instance attribute changed to the
new value after the error was raised, but now is correctly restored to the original value.
- Remove line double-spacing in PlainReporter and ColorReporter output code snippets.
💫 New checkers
Custom checkers:
- `invalid-name-checker`: Provide beginner-friendly error messages when reporting variable names
that violate Python naming conventions. This replaces pylint's
[C0103](https://pylint.pycqa.org/en/latest/user_guide/messages/convention/invalid-name.html)
check.