def add_report_cmd(subparsers): report_help = ("Produces a report of copyright header notices within " "selected targets to help identify files that don't meet " "expectations.") parser = subparsers.add_parser('report', help=report_help) parser.set_defaults(cmd=lambda o: ReportCmd(o)) add_jobs_option(parser) add_json_option(parser) add_git_tracked_targets_parameter(parser)
def add_check_cmd(subparsers): check_help = ("Validates that selected targets do not have copyright " "header issues, gives a per-file report and returns a " "non-zero shell status if there are any issues discovered.") parser = subparsers.add_parser('check', help=check_help) parser.set_defaults(cmd=lambda o: CheckCmd(o)) add_jobs_option(parser) add_json_option(parser) add_git_tracked_targets_parameter(parser)
def add_report_cmd(subparsers): report_help = ("Produces a report with the analysis of the code format " "adherence of the selected targets taken as a group.") parser = subparsers.add_parser('report', help=report_help) parser.set_defaults(cmd=lambda o: ReportCmd(o)) add_jobs_option(parser) add_json_option(parser) add_clang_options(parser, style_file=True) add_git_tracked_targets_parameter(parser)
def add_report_cmd(subparsers): report_help = ("Runs clang static analysis and produces a summary report " "of the findings.") parser = subparsers.add_parser('report', help=report_help) parser.set_defaults(cmd=lambda o: ReportCmd(o)) add_jobs_option(parser) add_json_option(parser) add_clang_options(parser, report_path=True) add_git_repository_parameter(parser)
def add_report_cmd(subparsers): report_help = ("Validates that the selected targets do not have basic " "style issues, give a per-file report and returns a " "non-zero shell status if there are any basic style issues " "discovered.") parser = subparsers.add_parser('report', help=report_help) parser.set_defaults(cmd=lambda o: ReportCmd(o)) add_jobs_option(parser) add_json_option(parser) add_git_tracked_targets_parameter(parser)
def add_check_cmd(subparsers): check_help = ("Validates that the selected targets match the style, gives " "a per-file report and returns a non-zero shell status if " "there are any format issues discovered.") parser = subparsers.add_parser('check', help=check_help) parser.set_defaults(cmd=lambda o: CheckCmd(o)) add_jobs_option(parser) add_json_option(parser) add_clang_options(parser, style_file=True, force=True) add_git_tracked_targets_parameter(parser)
def add_check_cmd(subparsers): check_help = ("Runs clang static analysis and output details for each " "discovered issue. Returns a non-zero shell status if any " "issues are found.") parser = subparsers.add_parser('check', help=check_help) parser.set_defaults(cmd=lambda o: CheckCmd(o)) add_jobs_option(parser) add_json_option(parser) add_clang_options(parser, report_path=True) add_git_repository_parameter(parser)
def add_fix_cmd(subparsers): fix_help = ("Applies basic style fixes to the target files.") parser = subparsers.add_parser('fix', help=fix_help) parser.set_defaults(cmd=lambda o: FixCmd(o)) add_jobs_option(parser) add_git_tracked_targets_parameter(parser)
"--git-branch", type=str, default='master', help=b_help) def add_directory_argument(parser): d_help = "Directory to hold the repository clone." parser.add_argument('directory', type=str, help=d_help) if __name__ == "__main__": description = ("Clones and builds a bitcoin repository with standard " "settings. BerkeleyDB 4.8 is also downloaded to the " "temporary directory and built as part of the process.") parser = argparse.ArgumentParser(description=description) add_tmp_directory_option(parser) add_jobs_option(parser) add_url_option(parser) add_branch_option(parser) add_directory_argument(parser) settings = parser.parse_args() repository = (bitcoin_setup_build_ready_repo( settings.tmp_directory, clone_directory=settings.directory, upstream_url=settings.clone_url, branch=settings.git_branch)) make_log = os.path.join(settings.tmp_directory, 'make.log') maker = Make(str(repository), make_log, jobs=settings.jobs) maker.run()