Skip to content

Support for linters like clang-format and clang-tidy #2606

@sandercox

Description

@sandercox

We’ve been using sccache successfully for normal compilation, but we recently started adding clang-tidy to our default build pipeline. This significantly increases CPU load because, even though the compilation step is usually cached by sccache, we still need to run the clang-tidy analysis on each file.
In theory, I could write my own caching layer for clang-tidy or use something like ctcache. However, ctcache is Python-based - which I’d prefer not to add as a dependency - and using two separate caching tools would complicate things. sccache already has robust features like statistics, cache eviction, and quotas that ctcache doesn’t seem to provide.
I understand that supporting clang-tidy is not as simple as adding another compiler backend, since it doesn’t produce build artifacts and mainly outputs to stdout.
I'm currently working on a proof of concept to explore whether clang-tidy support could fit within sccache. Before investing more time: would the project be open to a PR adding support for caching linters like clang-tidy, or is this considered outside the scope of sccache?
If it's out of scope, I’ll focus on alternative solutions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions