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 4
4
5
5
- * Action required:* Move existing behaviour under "parse" subcommand.
6
6
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.
7
8
- Use GA version of Python 3.11 in test matrix.
8
9
9
10
## v0.1.3 [ 2022-09-07]
Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ def main() -> None:
40
40
parse_parser = subparsers .add_parser (
41
41
"parse" , help = "Transform Mypy output into JSON."
42
42
)
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
+ )
43
50
44
51
parse_parser .set_defaults (func = _parse_command )
45
52
@@ -50,7 +57,7 @@ def main() -> None:
50
57
def _parse_command (args : argparse .Namespace ) -> None :
51
58
"""Handle the `parse` command."""
52
59
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 )
54
61
print (error_json )
55
62
56
63
You can’t perform that action at this time.
0 commit comments