[report-hook] take location of bugs.txt from the command line

Summary:
This was hardcoded but it's passed as an option to the script. It can be useful to generate text reports from arbitrary json reports, eg:

  ./infer/lib/python/report.py --issues-json infer-out/report.json --project-root . --results-dir infer-out --issues-txt foo.txt

Reviewed By: martinoluca

Differential Revision: D5526683

fbshipit-source-id: 3f9c3ee
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent cfecff03c3
commit 0bd5ef8d0f

@ -24,7 +24,7 @@ arg_parser.add_argument('--issues-csv', metavar='<file>',
arg_parser.add_argument('--issues-json', metavar='<file>', required=True,
help='Location of the json report')
arg_parser.add_argument('--issues-txt', metavar='<file>',
help='Location of the text report (ignored for now)')
help='Location of the text report')
arg_parser.add_argument('--issues-xml', metavar='<file>',
help='Location of the xml report (ignored for now)')
arg_parser.add_argument('--pmd-xml', action='store_true',
@ -38,9 +38,9 @@ arg_parser.add_argument('--results-dir', metavar='<directory>', required=True,
def main():
sys_argv = map(utils.decode, sys.argv)
args = arg_parser.parse_args(sys_argv[1:])
bugs_out = os.path.join(args.results_dir, config.BUGS_FILENAME)
issues.print_and_save_errors(args.results_dir, args.project_root,
args.issues_json, bugs_out, args.pmd_xml)
args.issues_json, args.issues_txt,
args.pmd_xml)
if __name__ == '__main__':

Loading…
Cancel
Save