def get_tidy_invocation(f, clang_tidy_binary, checks, build_path,
                        quiet, config):
    """Gets a command line for clang-tidy."""
    start = [clang_tidy_binary]
    # Show warnings in all in-project headers by default.
    start.append('-header-filter=src/')
    if checks:
        start.append('-checks=' + checks)
    start.append('-p=' + build_path)
    if quiet:
        start.append('-quiet')
    if config:
        start.append('-config=' + config)
    start.append(f)
    return start