llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Adding SARIF result format support for clang-tidy

Open shaopeng-gh opened this issue 4 years ago • 8 comments

Hello! We are interested in adding support for output in the open-standard SARIF format to the clang-tidy, if not yet implemented. SARIF support is required to integrate it in GitHub code scanning. Doing so would make it available to every repo in GitHub.

More about SARIF here: What is SARIF? Why SARIF?

If you agree, we will be happy to looking into necessary code changes and provide guidance on creating a workflow to make it available as a GitHub code scanner.

Thanks, Shaopeng

shaopeng-gh avatar May 23 '22 08:05 shaopeng-gh

@llvm/issue-subscribers-clang-tidy

llvmbot avatar May 23 '22 13:05 llvmbot

see https://discourse.llvm.org/t/rfc-improving-clang-s-diagnostics/62584

tschuett avatar May 23 '22 17:05 tschuett

Here is a third-party tool that converts clang-tidy output to sarif:

https://crates.io/crates/clang-tidy-sarif

https://github.com/psastras/sarif-rs/tree/main/clang-tidy-sarif

amitdo avatar Nov 14 '22 10:11 amitdo

Did this work die out? It's always bugging me that clang tidy is hard to integrate in other tooling.

elupus avatar May 05 '26 13:05 elupus

Clang-tidy development is essentially on a volunteer basis. So the work remains pending unless someone volunteers to do it.

LegalizeAdulthood avatar May 05 '26 15:05 LegalizeAdulthood

Yup, but looked like @shaopeng-gh had an interest in adding it.

elupus avatar May 05 '26 15:05 elupus

IMO, there is no need to wait for someone to approve your willingness to do something. Just do it and submit the PR for concrete feedback. If the endeavor is lengthy and you wish to explore the idea before implementation, the proper venue for that discussion is the discourse server. Not everyone tracks every conversation taking place on a github issue.

LegalizeAdulthood avatar May 05 '26 21:05 LegalizeAdulthood

JFYI, there is a PR to add initial support for SARIF in clang-tidy

https://github.com/llvm/llvm-project/pull/219182

BaLiKfromUA avatar Sep 08 '26 15:09 BaLiKfromUA