Skip to content

[2.8.0] 2024-08-19

Compare
Choose a tag to compare
@david-yz-liu david-yz-liu released this 20 Aug 03:23

WARNING: this release assumes that the z3-solver Python library is installed. Users are strongly encouraged to install v2.8.1 instead.

✨ Enhancements

  • Add new boolean configuration allow-local-imports to allow for local imports
  • Extended the snasphot function to include the relevant variables defined at the top level (global variables).
  • Include the pycodestyle error code to the error message for PEP8 style errors
  • Added date and time display to PlainReporter and ColorReporter
  • Allowed specifying allowed names in configurations allowed-import-modules and extra-imports instead of just modules
  • Improved error display for pycodestyle (E9989) errors E123, E203, E222, E226, and E262
  • Added the configuration option to ignore naming convention violations (C9103 and C9104) for names matching the provided regular expression.
  • Update to pylint v3.1 and and astroid v3.1
  • Stored actual AST condition node in edges leading out of If/While blocks in generated control flow graphs.
  • Stored valid Python function preconditions in initial edge to function code in generated function control flow graphs.
  • Report warning when control flow graph creation encounters a syntax error related to control flow
  • Added autoformat option that runs black formatting tool to python_ta.check_all()
  • Extended the snapshot function to optionally generate a svg of the snapshot using MemoryViz when save parameter is true.

💫 New checkers

Pylint checkers v3.1:

  • use-yield-from
  • deprecated-attribute

For more information on these checkers, please see the
Pylint release notes. Note that the above
list only contains the Pylint checkers enabled by default in PythonTA.

Custom checkers:

  • inconsistent-returns and missing-return-statement: Provide clearer error messages when reporting missing return statements. This replaces pylint's R1710 check.

🐛 Bug fixes

  • Fixed issue with error message of C0410 by reformating it to properly fit with the list of modules imported that are provided to it
  • Fixed bug where _ was marked as a built-in when running PythonTA after running doctest
  • Fixed issue where annotated constant variable assignment was not considered as permissible top level code and triggered error E9992
  • Fixed issue where top level class attribute assignment was considered as permissible top level code
  • Fixed issue where check_contracts fails silently when function preconditions contain precondition violations, and when a representation invariant contains a call to a top-level function (not built-in or imported library).
  • Fixed issue where methods called in representation invariants lead to infinite recursion.
  • Fixed issue where PossiblyUndefinedChecker raised an error if the control flow graph was invalid due to syntax error

🔧 Internal changes

  • Updated changelog and pull request template formats
  • Added unit tests for PEP8 errors E115, E122, E125, E127, E129, E131 for PycodestyleChecker
  • Added unit tests for PEP8 errors E223, E224, E227, E228, E265 for PycodestyleChecker
  • Refactored test_check_on_dir in test_check.py module to test on sample_dir, a subset of examples
  • Added unit test test_examples_files_pyta in test_examples.py to check every file in examples with PythonTA
  • Added unit tests for PEP8 errors E266, E275, E301, E303, E304 for PycodestyleChecker
  • Moved tests related to __main__.py from test_check.py to test_main.py
  • Added more unit tests to test_main.py to increase coverage of __main__.py to 100%
  • Updated README.md to reflect updated folder structure
  • Added unit test test_pycodestyle_errors_pyta in test_examples.py to check every file in e9989_pycodestyle with PythonTA for PEP8 errors
  • Parametrized tests for PycodestyleChecker
  • Moved tests related to snapshot.py out of test_accumulation_table.py and into new module test_snapshot.py
  • Updated GitHub Action tests to avoid running test_accumulation_table.py and test_recursion_table.py with coverage and add verbose output for debug testing
  • Allowed GitHub Action tests to run on all pull requests, including drafts
  • Updated dependencies for GitHub Actions to use the latest versions
  • Updated dependabot configuration to auto-update dependencies for GitHub Actions in the future
  • Updated usage messages in examples/sample_usage/ of draw_cfg.py and print_ast.py to be accurate on all operating systems
  • Removed redundant line from tests/test_examples.py
  • Fixed minor typo in an error message in python_ta/cfg/visitor.py
  • Updated ExprWrapper to support set/list/tuple literals and in/not in operators
  • Updated snapshot.py and test_snapshot.py to align with MemoryViz 0.2.0 updates
  • Updated ExprWrapper to support string variables and ==, in/not in, indexing and slicing operators
  • Added protected _z3_vars attribute to ControlFlowGraph to store variables to be used in Z3 solver
  • Removed unused imports from python_ta/cfg/graph.py
  • Extended functionality of ExprWrapper class to include function definitions' arguments and name assignments
  • Added z3 to dependencies installed as part of the docs job in the GitHub Actions workflow
  • Added tests to maintain/increase coverage of visitor.py, graph.py, and ExprWrapper.py
  • Removed deprecated and redundant future argument from node.frame() call in invalid_name_checker.py
  • Updated pylint to v3.2.6 and astroid to v3.2.4 (no new checks were enabled by default)
  • Excluded node_modules/ folder from package autodiscovery
  • Updated graph.py to augment control flow graph edges with z3 constraints
  • Added support for the != operator and replaced dictionary indexing with .get in ExprWrapper.
  • Refactored Z3Visitor to use safe_infer() instead of inferred() and added handling of AstroidError.
  • Add negate attribute to CFGEdge