Add --json option to report

#60 Declined
Repository
coverage.py
Branch
json_report
Repository
coverage.py
Branch
default
Author
  1. Alexander Todorov
Reviewers
Description

This PR adds the --json option to the report command so we can produce machine readable reports instead of human readable and updates the test suite.

Comments (3)

  1. Ned Batchelder repo owner

    I understand the appeal of a supported JSON report. It's probably a good idea. But it should be a separate command, not a --json switch on the text report. XML and HTML are their own commands, not switches, so JSON should follow suit.

  2. Alexander Todorov author

    Ned, are you OK with the changes to summary.py + a new json command ? Adding new command is relatively easy but I don't think it is a good idea to repeat the report method of SummaryReporter or create a whole new class (like JSON reporter) for that ? What is you preference ?

  3. Ned Batchelder repo owner

    I would think that the amount of code that's different between "report" and "json" would be much larger than the amount of code that is the same between them. I would prefer a new class to handle this report.