def checkTools():
    error_messages = []
    clang_format_abs_path = lookPath(CLANG_FORMAT_PATH)
    if clang_format_abs_path:
        if (not executableByOthers(clang_format_abs_path)):
            error_messages.append('command {} exists, but cannot be executed by other users'.format(CLANG_FORMAT_PATH))
    else:
        error_messages.append("Command {} not found. If you have clang-format in version 8.x.x installed, but the binary name is different or it's not available in PATH, please use CLANG_FORMAT environment variable to specify the path. Examples:\n    export CLANG_FORMAT=clang-format-9.0.0\n    export CLANG_FORMAT=/opt/bin/clang-format-9\n    export CLANG_FORMAT=/usr/local/opt/llvm@9/bin/clang-format".format(CLANG_FORMAT_PATH))

    def checkBazelTool(name, path, var):
        bazel_tool_abs_path = lookPath(path)
        if bazel_tool_abs_path:
            if (not executableByOthers(bazel_tool_abs_path)):
                error_messages.append('command {} exists, but cannot be executed by other users'.format(path))
        elif pathExists(path):
            if (not executableByOthers(path)):
                error_messages.append('command {} exists, but cannot be executed by other users'.format(path))
        else:
            error_messages.append("Command {} not found. If you have buildifier installed, but the binary name is different or it's not available in $GOPATH/bin, please use {} environment variable to specify the path. Example:\n    export {}=/opt/bin/buildifier\nIf you don't have buildifier installed, you can install it by:\n    go get -u github.com/bazelbuild/buildtools/{}".format(path, var, var, name))
    checkBazelTool('buildifier', BUILDIFIER_PATH, 'BUILDIFIER_BIN')
    checkBazelTool('buildozer', BUILDOZER_PATH, 'BUILDOZER_BIN')
    return error_messages
def checkTools():
    error_messages = []
    clang_format_abs_path = lookPath(CLANG_FORMAT_PATH)
    if clang_format_abs_path:
        if (not executableByOthers(clang_format_abs_path)):
            error_messages.append('command {} exists, but cannot be executed by other users'.format(CLANG_FORMAT_PATH))
    else:
        error_messages.append("Command {} not found. If you have clang-format in version 8.x.x installed, but the binary name is different or it's not available in PATH, please use CLANG_FORMAT environment variable to specify the path. Examples:\n    export CLANG_FORMAT=clang-format-9.0.0\n    export CLANG_FORMAT=/opt/bin/clang-format-9\n    export CLANG_FORMAT=/usr/local/opt/llvm@9/bin/clang-format".format(CLANG_FORMAT_PATH))

    def checkBazelTool(name, path, var):
        bazel_tool_abs_path = lookPath(path)
        if bazel_tool_abs_path:
            if (not executableByOthers(bazel_tool_abs_path)):
                error_messages.append('command {} exists, but cannot be executed by other users'.format(path))
        elif pathExists(path):
            if (not executableByOthers(path)):
                error_messages.append('command {} exists, but cannot be executed by other users'.format(path))
        else:
            error_messages.append("Command {} not found. If you have buildifier installed, but the binary name is different or it's not available in $GOPATH/bin, please use {} environment variable to specify the path. Example:\n    export {}=/opt/bin/buildifier\nIf you don't have buildifier installed, you can install it by:\n    go get -u github.com/bazelbuild/buildtools/{}".format(path, var, var, name))
    checkBazelTool('buildifier', BUILDIFIER_PATH, 'BUILDIFIER_BIN')
    checkBazelTool('buildozer', BUILDOZER_PATH, 'BUILDOZER_BIN')
    return error_messages