Implementing cppcoreguideline "avoid non-const global variables"

Hi, I’m writing for the first time to this mailing list and hoping to be able to make some contributions to clang tidy in the future. I’m a bit excited
I wanted to learn how to write clang checks for clang tidy and I figured a good start would be to see if there are any simple checks missing from cpp core guidelines. I couldn’t find an implementation for this check:

-and so I assumed that it was needed and it seemed like a good check for a beginning clang tidy contributor.

I have started work on the implementation but I haven’t tested it much and I haven’t written the unit test so I’m not ready for a review, however I figured it would still be good to check in with the mailing list to confirm that the check actually isn’t implemented somewhere else or currently being worked on by someone else.

Also I thought that by bringing this up now I might find an appropriate reviewer for my patch once it is ready for review, provided it is a reasonable change and something to continue working on.

Am I on a good track or should I use a different approach for starting to contribute clang tidy checks?


thats a good approach to learning clang-tidy!
I think it is ok to write some tests and then post it for code-review. Just add “[clang-tidy] …” in the title and then the right reviewers will pick it up :slight_smile:

Don’t be afraid or hesitate for code review. From my experience thats the best way to get introduced into the code base.

Best Regards