Template for a good new topic, formatted with Markdown:
ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
Scanner command used when applicable (private details masked)
Languages of the repository
Only if the SonarCloud project is public, the URL
And if you need help with pull request decoration, then the URL to the PR too
Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
Steps to reproduce
Potential workaround
Hello,
We are using SonarCloud to analyse C++ code baseline. I’m looking for a solution if sonar ecosystem provides naming convention checking for C++. I’m particularly interested in how we can enable sonar for both CLI and for IDEs to verify correct naming conventions for variables, classes and structs are applied. Do you have any recommendation?
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
Following it up, would it be possible to extend those naming conventions? For example, would it be possible to separate private and public member variables? How can we define our own custom rule set for naming conventions if it doesn’t exist in the second link you shared?
Defining your own CFamily rules is not possible, but you can import reports generated by other tools, so you could conceivably roll out something based on clang’s json dump of the AST (which is not necessarily stable between releases, though).
What rules do you have in mind, apart of differentiating between public/protected/private member variables?
Unfortunately, there is nothing on the roadmap in this respect. I have forwarded this thread to our PM, though, so we note the interest in a feature like this.
Thanks for reaching out.
I can see the clang-tidy check is indeed more refined and configurable than what we offer.
Please, would you be able to elaborate on what you need specifically that is not covered by the rules that @aalvarez mentioned?