コード例 #1
0
ファイル: __main__.py プロジェクト: isameer/pytorch
def main() -> None:
    options = parse_args()

    if not pathlib.Path("build").exists():
        generate_build_files()

    # Check if clang-tidy executable exists
    exists = os.access(options.clang_tidy_exe, os.X_OK)

    if not exists:
        msg = ("Could not find '.clang-tidy-bin/clang-tidy'\n"
               "You can install it by running:\n"
               "   python3 tools/linter/install/clang_tidy.py")
        raise RuntimeError(msg)

    return_code = run(options)
    if return_code != 0:
        raise RuntimeError("Warnings found in clang-tidy output!")
コード例 #2
0
ファイル: __main__.py プロジェクト: JianpingChen066/pytorch-1
def main() -> None:
    options = parse_args()

    if not pathlib.Path("build").exists():
        generate_build_files()

    # Check if clang-tidy executable exists
    exists = os.access(options.clang_tidy_exe, os.X_OK)

    if not exists:
        msg = (
            f"Could not find '{options.clang_tidy_exe}'\n" +
            "We provide a custom build of clang-tidy that has additional checks.\n"
            + "You can install it by running:\n" +
            "$ python3 tools/linter/install/clang_tidy.py")
        raise RuntimeError(msg)

    result, _ = run(options)
    sys.exit(result.returncode)