Skip to content

Best way to add/extend Clang Tidy rules defined in this plugin ? #2378

@aallrd

Description

@aallrd

Hello,

I am using your plugin to parse and display Clang Tidy / Warnings (diagnostics) reports in SonarQube and it is working great.
As far as I understood, the rules used to match the content from the above reports come from the plugin itself:

From what I gathered, this file is generated using generate_clangtidy_resources.cmd and with every new release of LLVM/Clang this XML rule file is rebuilt and a new release of the plugin is done to update the list/content of Clang Tidy / Warnings (diagnostics) rules.

I have a custom build of LLVM/Clang with my own custom Clang Tidy checks defined besides the standard ones, and I would like to add rules in SonarQube to display these checks along the default ones.

The ideas I had to do that:

  1. Manually create the rule using the Rule template for Clang-Tidy custom rules

Cumbersome and error prone, but seems like the only manual/UI solution available...

  1. Use the provided generate_clangtidy_resources.sh to generate the clangtidy.xml for my custom LLVM/Clang build

Seems ideal because reusing the same automated workflow used by the plugin, however I have no clue what to do next once I have generated my custom clangtidy.xml, do I rebuild the plugin or simply copy/paste this file on the SonarQube server?

  1. Create my own CXX plugin following https://github.com/SonarOpenCommunity/cxx-custom-checks-example-plugin

Seems a bit too much just to add a few rules.

  1. Something else?

What would be the best way to proceed in your opinion?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions