Skip to content

Parallel Execution for clang-tidy #198

@shenxianpeng

Description

@shenxianpeng

Problem

On large codebases, the clang-tidy hook can be very slow because files are
processed one at a time. This makes the pre-commit experience frustrating
and leads developers to skip or bypass the hook.

Proposed Solution

Add a --jobs / -j argument to run clang-tidy on multiple files in parallel:

- id: clang-tidy
  args: [--checks=.clang-tidy, --version=21, --jobs=4]

This could be implemented using Python’s concurrent.futures.ThreadPoolExecutor
or multiprocessing.Pool internally.

Expected Benefit

A 4x–8x speedup on projects with dozens of files, making the hook
practical for commit-time use without the need for aggressive files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions