notskm / vscode-clang-tidy

MIT License
49 stars 25 forks source link

Support straight C in addition to C++ #18

Closed relder closed 4 years ago

relder commented 4 years ago

Hi, I'd love it if this VSCode extension supported regular C as well. This seems to work for me.

notskm commented 4 years ago

Does clang-tidy work on C? I was under the impression it was only really useful in C++.

If you have C++ code in .h and .c files, I guess this still makes sense, but I'm a bit worried about it linting C code.

relder commented 4 years ago

Given C++ is a superset of C, yes, works fine. Been using my version for months on straight C, finds mem leaks, null pointer derefs, bad indentation, etc. If anything there are too many checks that work on C (too much noise, overly picky on style). The whole class of C++ checks is of course pointless, but I get much use out of it in our straight C project.

notskm commented 4 years ago

I'm going to look into blacklisting files before I merge this. That way users will be able to opt out.

17

theswordsmahin commented 4 years ago

Is there an ETA on this one? I am also looking for a solution to this for C files to support checks that do not seem to be supported with just clangd. Thanks

notskm commented 4 years ago

@theswordsmahin I'm working on adding a blacklist now. Hopefully, this will be ready within a few days, but no promises.