[cfe-users] Using clang-tidy to lint whitespace issues?

Bryan, Matthew via cfe-users cfe-users at lists.llvm.org
Tue May 10 17:57:59 PDT 2016


Green horn questions:

At Isilon we are looking into the possibility of using clang-tidy to do some of our C and C++ linting, specifically to create some clang-tidy checks out of BSD's style(9).  I'm curious about how/if we can check for whitespace issues (e.g. having spaces and not tabs at the start of each line in the source) using this tool.  It looks like the AST style of check is how most checks are written, but I'm wondering if it can be used for checking whitespace line-by-line in the source?

And how does macro expansion play with that?  I notice that after running clang-check -ast-print on a simple file, the macros appear to have been already expanded.  I'm worried that expanding multi-line macros that have their own whitespace etc. could end up making whitespace checks report false positives.  Is it possible to use the information in the AST to get around that?  Other ideas?

Thanks,

Matt Bryan
Principal Software Development Engineer
Vertical Campaigns Team
EMC Isilon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20160511/3cd955d9/attachment.html>


More information about the cfe-users mailing list