All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and adheres to Semantic Versioning.
- Added new command line argument
-v/--version
. User can print out current PythonTA version usingpython -m python_ta -v
. - Preconditions, postconditions, and representation invariants are now parsed only once and compiled.
- Can configure custom error messages for pylint in a toml file.
- Function
check_all_contracts
skips contract checks for functions and classes which are not defined in a module whose name is passed as an argument. Ifdecorate_main
argument isTrue
, functions and classes defined in__main__
module will be checked without needing to pass in additional arguments.
Pylint checkers v2.13:
modified-iterating-list
modified-iterating-dict
modified-iterating-set
unnecessary-ellipsis
bad-file-encoding
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.
- Added support for postconditions in function docstring.
- Improve error message of
unncessary-indexing
checker. - Added CLI for
python_ta.contracts
module for executing a file with contract checking ($ python -m python_ta.contracts FILE
) - Added two new command line interfaces. User can print out the default PythonTA configuration file in the command line using
python -m python_ta -g
and can specify the output format of the reporter usingpython -m python_ta --output-format FILE
. - Updated to Pylint v2.12. See "New checks" below for the new checkers enabled by default.
- Register ending location setter as pylint plugin.
- Fix bugs in
unnecessary-indexing
checker:- False positive when the same loop variable is used in two loops in sequence.
- False negative when the loop variable can be simplified, but is also shadowed in the the loop body.
- Fix HTML report to link correctly to specific errors on the PythonTA documentation website.
- Fix bug when setting ending locations for
ClassDef
s that have no decorators.
Pylint checkers v2.12:
use-implicit-booleaness-not-len
(renamed fromlen-as-condition
)
Pylint checkers v2.11:
consider-using-f-string
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.
- Fix HTML report to display file even when no errors are found.
- Fix pylint cache directory creation (backport of change from pylint 2.11)
- Added
line_end
andcolumn_end
toJSONReporter
output.
PythonTA's adopting semantic versioning as of this release, so we've bumped the version to 2.0.
- Added basic CLI. Users can now run PythonTA in the command line either as a standalone
script (
$ python_ta my_file
) or as a Python module ($ python -m python_ta my_file
). - Added new documentation website, hosted at https://www.cs.toronto.edu/~david/pyta.
- Added support for relative paths in
output
argument tocheck_all
. - Added new configuration option
pycodestyle-ignore
to customize the pycodestyle errors checked bypep8-errors
.
- Changed HTML report template to make it more user-friendly.
- Changed default HTML report output: by default now loads in a web browser without creating
a temporary file (previously,
pyta_report.html
). This file can still be generated by passingoutput='pyta_report.html'
to calls tocheck_all
. - Added new
output-format
option to specify reporter class. - Changed API of PythonTA custom reporters.
- Updated to Pylint v2.10. See "New checks" below for the new checks enabled by default.
- Renamed
for-target-subscript
checker toinvalid-for-target
, and added support checking for loop targets that are attributes (e.g.,for obj.x in [1, 2, 3]
). (#701)
- Fixed bug with
python_ta.contracts
: do not check representation invariants when a helper method is called within an initializer. - Fixed bug with
python_ta.contracts
: do not check class representation invariants in the initializer of a superclass. - Fixed bug with
shadowing-in-comprehension
checker: do not treat_
as a shadowed variable. - Fixed bug with
unnecessary-indexing
checker: handle case where loop variable is first assigned before the for loop. (#699) - Fixed bug where PythonTA would crash on files that used encodings other than UTF-8. PythonTA now reports an error and displays the invalid characters to the user.
- Deprecated
pyta-reporter
option; useoutput-format
instead.
Custom checkers:
missing-space-in-doctest
: Flag when a doctest prompt (>>>
) is not followed by a space. E.g.,>>>my_function(1)
.
Pylint checkers v2.10:
forgotten-debug-statement
format-string-without-interpolation
use-dict-literal
use-list-literal
Pylint checkers v2.9:
consider-using-from-import
unnecessary-dict-index-lookup
Pylint checkers v2.8:
consider-using-with
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.
- Adopted semantic versioning.
- Created a Changelog.
- Added pre-commit hooks using pre-commit, black, isort, and prettier.
- Adopted Sphinx for documentation generation, using a Read the Docs template.
- Adopted
setup.cfg
file for configuration.