diff --git a/infer/bin/BuckAnalyze b/infer/bin/BuckAnalyze index f79cf09e8..7da11f182 100755 --- a/infer/bin/BuckAnalyze +++ b/infer/bin/BuckAnalyze @@ -440,7 +440,7 @@ def collect_results(args, start_time): stats_filename = os.path.join(args.infer_out, utils.STATS_FILENAME) with open(stats_filename, 'w') as stats_out: - json.dump(stats, stats_out) + json.dump(stats, stats_out, indent=2) basic_stats = get_basic_stats(stats) diff --git a/infer/bin/inferlib.py b/infer/bin/inferlib.py index e52e0d633..8ccfaa3e4 100644 --- a/infer/bin/inferlib.py +++ b/infer/bin/inferlib.py @@ -629,7 +629,7 @@ class Infer: self.stats['normal']['infer_version'] = utils.infer_version() with open(stats_path, 'w') as stats_file: - json.dump(self.stats, stats_file) + json.dump(self.stats, stats_file, indent=2) def close(self): if self.args.analyzer != COMPILE: diff --git a/infer/bin/utils.py b/infer/bin/utils.py index 3a5ba97f9..5b332a890 100644 --- a/infer/bin/utils.py +++ b/infer/bin/utils.py @@ -348,8 +348,8 @@ def create_json_report(out_dir): rows = [row for row in reader] with open(json_report_filename, 'w') as file_out: headers = rows[0] - issues = rows[1:] - json.dump([dict(zip(headers, row)) for row in issues], file_out) + issues = [dict(zip(headers, row)) for row in rows[1:]] + json.dump(issues, file_out, indent=2) class AbsolutePathAction(argparse.Action):