ModernCppStarter icon indicating copy to clipboard operation
ModernCppStarter copied to clipboard

copy paste .clang-tidy from a modern-cpp-template

Open Gerodote opened this issue 2 months ago • 4 comments

It's a really good default. It's copy-paste from https://github.com/filipdutescu/modern-cpp-template with one modification: turn off warnings as error for clang-tidy.

Gerodote avatar Apr 16 '24 12:04 Gerodote

Thanks for the answer and for your efforts to make the starter better!

I think using clang-tidy as warning tool or warning-as-error tool is amazing actually.

I prefer use it as warning-generating tool to find out more problems with code from c++ point of view.

During my use of clang-tidy I found out that with the config the only stuff that makes it warning-as-error is declaring function with an unused parameter and the parameter should be not commented to get warning-as-error behaviour. I genuinely don't know how to disable it, though, I guess it's an OK warning-as-error.

Because of the points above, I guess it would be good to have a github workflow that passes through clang-tidy a codebase to show the error, generate a lot of warnings ( even performance related ) or , if user of the starter changes the .clang-tidy to make a warning into warning-as-error , to generate error.

However, I'm not so proficient with github workflows. I would be pleased If someone can do that or help with it.

Gerodote avatar Apr 22 '24 22:04 Gerodote

Thanks for the explanations! Unfortunately I'm currently too busy to help out, but would be happy to include this if we can manage to add a linter step to the workflows!

TheLartians avatar May 08 '24 14:05 TheLartians

Seems like you do have clang-format but also don't check it automatically on the gh actions. For clang-tidy seems like here you already have a way to run clang-tidy.

Do you want someone to create a specific step on the actions? There are a few options for that on the marketplace, I can try to test one or two if you prefer.

Paiusco avatar May 08 '24 19:05 Paiusco