Hacker News new | ask | show | jobs
by mavam 3379 days ago
It would be great to see such elaborate guidelines to be accompanied with an integration into a linting tool, such as clang-tidy.
3 comments

I thought there was a checker (based on clang) included by the CPP Core Guidelines [0], but I'm not seeing it there currently. Must have been external. I know I saw a tool that provided partial support, at least for GSL [1] (MS's library support of the the CPP Core Guidelines).

[0] https://github.com/isocpp/CppCoreGuidelines [1] https://github.com/microsoft/gsl/

Maybe I'm misunderstanding your reply, but the GSL is the checker. It adds header constructs that create compile time errors based on bad practices. The whole point is that there is no need for an external tool.
the GSL is the checker

Well it's a bunch of headers declaring useful types and functions. If you don't use them the compiler won't complain and nothing is checked. I think the OP means something like static analysis.

I found a note in my C++14/17 TODO list where I typed 'clang-tidy might be able to give warnings for pre-c++14 constructs etc, see https://reviews.llvm.org/diffusion/L/browse/clang-tools-extr.... Don't have time now to figure out what that is, but it's probably what the OP is after.

The clang-tidy tool has some C++ Core Guideline checks under the cppcoreguidelines module.
Some of these rules are currently in clang-tidy, but the coverage is by no means comprehensive. Patches always welcome. :-)
There are integrations of this and various other coding standards into some commercial tools; I don't recall seeing them in any free tools yet.