xmake icon indicating copy to clipboard operation
xmake copied to clipboard

Clang tidy

Open maximegmd opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

It would be very helpful if xmake could run clang-tidy actions natively so we could get helpful information on any platform without having to generate vs projects or specific make files.

Describe the solution you'd like

xmake tidy or an action in projects/makefiles to run clang-tidy.

Describe alternatives you've considered

Apart from making a custom makefile/vs project I don't see any option.

Additional context

https://devblogs.microsoft.com/cppblog/code-analysis-with-clang-tidy-in-visual-studio/

maximegmd avatar Apr 27 '21 12:04 maximegmd

You can write an extension plugin and submit it to https://github.com/xmake-io/xmake-plugins, it does not need to be built into xmake.

We only need to execute the following commands to pull these extensions and use them.

xmake plugin --install
xmake clang-tidy

But I don't have time to implement this plugin. sorry.

waruqi avatar Apr 27 '21 13:04 waruqi

It's already extremely convenient. We just need to export compile_commands and then simply run clang-tidy

xmake project -k compile_commands
run-clang-tidy

A simple bash script or a hook in xmake.lua would suffice.

jkawnkwh85 avatar Dec 07 '22 05:12 jkawnkwh85

It's already extremely convenient. We just need to export compile_commands and then simply run clang-tidy

xmake project -k compile_commands
run-clang-tidy

A simple bash script or a hook in xmake.lua would suffice.

I am a new user of xmake. Recently, I want to use Clang-Tidy, but I found a problem, that is, Clang-Tidy will check the third-party library managed by xmake (xrepo), such as spdlog\fmt. How do you avoid this?

Pang-GJ avatar Jan 14 '23 07:01 Pang-GJ

I have supported it. https://github.com/xmake-io/xmake/issues/3326

waruqi avatar Feb 01 '23 16:02 waruqi