-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flag for printing reports in colour (#89)
* Remove unused test constant This was last referenced in 44a7fed. * Extract logic for writing change reports Before this change the logic for writing the report to stdout was a part of ChangeTracker. By extracting this to a separate class, we allow for other writer classes to be implemented. * Add ColorChangeReportWriter This class can be used to print out change reports in colour. The colours selected closely match those output by Mypy, with the exception that links are not highlighted in notes. The logic is inspired by Mypy's highlighting code. (See https://github.com/python/mypy/blob/f9e8e0bda5cfbb54d6a8f9e482aa25da28a1a635/mypy/util.py#L761) This supports only ANSI colours, so I suspect that this will not work on Windows. * Add flag for printing change reports in colour * Print out mypy test results in colour * Add docstring to DefaultChangeReportWriter * Update change log with new `--color` flag * Change spacing around report summary Before this change an empty line would be printed above the summary when there were no new errors, and no empty line would be printed when there were errors. This change reverses that. An empty line is printed to separate the summary from the new errors only if there are new errors.
- Loading branch information
Showing
4 changed files
with
321 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.