tools/clang_tidy.py
def run_clang_tidy(options, line_filters, files):
    """Executes the actual clang-tidy command in the shell."""
    command = [options.clang_tidy_exe, "-p", options.compile_commands_dir]
    if not options.config_file and os.path.exists(".clang-tidy"):
        options.config_file = ".clang-tidy"
    if options.config_file:
        import yaml

        with open(options.config_file) as config:
            # Here we convert the YAML config file to a JSON blob.
            command += ["-config", json.dumps(yaml.load(config))]
    if options.checks:
        command += ["-checks", options.checks]
    if line_filters:
        command += ["-line-filter", json.dumps(line_filters)]
    command += ["-{}".format(arg) for arg in options.extra_args]
    command += files

    if options.verbose:
        print(" ".join(command))
    if options.show_command_only:
        command = [re.sub(r"^([{[].*[]}])$", r"'\1'", arg) for arg in command]
        return " ".join(command)

    return run_shell_command(command)
Executes the actual clang-tidy command in the shell.
Executes the actual clang-tidy command in the shell.
Executes the actual clang - tidy command in the shell .
def run_clang_tidy(options, line_filters, files):
    command = [options.clang_tidy_exe, "-p", options.compile_commands_dir]
    if not options.config_file and os.path.exists(".clang-tidy"):
        options.config_file = ".clang-tidy"
    if options.config_file:
        import yaml
        with open(options.config_file) as config:
            command += ["-config", json.dumps(yaml.load(config))]
    if options.checks:
        command += ["-checks", options.checks]
    if line_filters:
        command += ["-line-filter", json.dumps(line_filters)]
    command += ["-{}".format(arg) for arg in options.extra_args]
    command += files
    if options.verbose:
        print(" ".join(command))
    if options.show_command_only:
        command = [re.sub(r"^([{[].*[]}])$", r"'\1'", arg) for arg in command]
        return " ".join(command)
    return run_shell_command(command)
def run_clang_tidy ( options , line_filters , files ) : command = [ options . clang_tidy_exe , "-p" , options . compile_commands_dir ] if not options . config_file and os . path . exists ( ".clang-tidy" ) : options . config_file = ".clang-tidy" if options . config_file : import yaml with open ( options . config_file ) as config : command += [ "-config" , json . dumps ( yaml . load ( config ) ) ] if options . checks : command += [ "-checks" , options . checks ] if line_filters : command += [ "-line-filter" , json . dumps ( line_filters ) ] command += [ "-{}" . format ( arg ) for arg in options . extra_args ] command += files if options . verbose : print ( " " . join ( command ) ) if options . show_command_only : command = [ re . sub ( r"^([{[].*[]}])$" , r"'\1'" , arg ) for arg in command ] return " " . join ( command ) return run_shell_command ( command )
Executes the actual clang-tidy command in the shell.
Executes the actual clang - tidy command in the shell .
"""Executes the actual clang-tidy command in the shell.""" # Here we convert the YAML config file to a JSON blob.
options
line_filters
files