File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 44
55- * Action required:* Move existing behaviour under "parse" subcommand.
66 Invocations of ` mypy-json-report ` should now be replaced with ` mypy-json-report parse ` .
7+ - Add ` parse --indentation ` flag to grant control over how much indentation is used in the JSON report.
78- Use GA version of Python 3.11 in test matrix.
89
910## v0.1.3 [ 2022-09-07]
Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ def main() -> None:
4040 parse_parser = subparsers .add_parser (
4141 "parse" , help = "Transform Mypy output into JSON."
4242 )
43+ parse_parser .add_argument (
44+ "-i" ,
45+ "--indentation" ,
46+ type = int ,
47+ default = 2 ,
48+ help = "Number of spaces to indent JSON output." ,
49+ )
4350
4451 parse_parser .set_defaults (func = _parse_command )
4552
@@ -50,7 +57,7 @@ def main() -> None:
5057def _parse_command (args : argparse .Namespace ) -> None :
5158 """Handle the `parse` command."""
5259 errors = parse_errors_report (sys .stdin )
53- error_json = json .dumps (errors , sort_keys = True , indent = 2 )
60+ error_json = json .dumps (errors , sort_keys = True , indent = args . indentation )
5461 print (error_json )
5562
5663
You can’t perform that action at this time.
0 commit comments