Lines Matching +full:clang +full:- +full:format +full:- +full:version
44 DEFAULT_CLANG_FORMAT = 'clang-format'
46 CLANG_TOOL_VERSION_MATCH = r"(clang-format|LLVM) version ([\d]+)\.[\d]+\.[\d]+.*$"
52 description = '''This tool runs `clang-format` on C++ files.
53 If no files are provided on the command-line, all C++ source files are
59 parser.add_argument('--clang-format', default=DEFAULT_CLANG_FORMAT,
60 help='Path to clang-format.')
61 parser.add_argument('--in-place', '-i',
64 parser.add_argument('--jobs', '-j', metavar = 'N', type = int, nargs = '?',
76 cmd = '%s -version' % tool
79 rc, version = util.getstatusoutput(cmd)
84 util.abort("Failed to execute %s: %s" % (cmd, version))
85 m = re.search(CLANG_TOOL_VERSION_MATCH, version, re.MULTILINE)
87 util.abort("Failed to get clang tool version: %s" % version)
96 supported_tools = [tool] + [tool + '-' + str(ver) for ver in CLANG_TOOL_SUPPORTED_VERSIONS]
119 cmd_diff = ['diff', '--unified', filename, temp_file_name]
127 ['colordiff', '--unified'],
138 cmd_format = [clang_format, '-i', filename]
173 clang_format = detect_clang_tool("clang-format")
176 error_message = "clang-format not found. Please ensure it " \
177 "is installed, in your PATH and the correct version."
179 return -1