[llvm-dev] clang-tidy standalone

martin lampacher via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 3 02:36:51 PDT 2019


Hello,

sorry for posting this here but I'm kind of stuck. I'm trying to introduce LLVM tooling step by step at the company I'm working for. So far I'm using clang-format for automated formatting.

Since I'm also working on the coding guideline I wanted to use clang-tidy for enforcing the naming convention. The problem is that we're using a plain old MAKE project, so I can't really benefit from the CMAKE integration.

The idea was to simply run clang-format and clang-tidy alongside the normal MAKE process, it's quite easy to integrate into the ruleset.

With clang-tidy I have the problem that it is trying to do "to much". So even if I'm disabling all rules but 'readability-identifier-naming ' the tool will still execute clang-diagnostic-error checks.

Full example:

dummy.c

#include "dummy.h"
#include "MISSING_module.h"

// EOF
dummy.h

#ifndef _DUMMY_H_
#define _DUMMY_H_

#include <stdlib.h>

// EOF
I'm trying to execute the following command (macos)

clang-tidy dummy.c -checks='-*,readability-identifier-naming' -- -DCMAKE_EXPORT_COMPILE_COMMANDS=ON`
however, clang-tidy is still checking/following the includes (one of which doesn't even exist - but I'm just using it for naming convention checks), I get the following error message:

dummy.h:4:10: error: 'stdlib.h' file not found [clang-diagnostic-error]
#include <stdlib.h>
          ^
Found compiler error(s).
Is there any way to disable the clang-diagnostic rules?

Cheers,
Martin




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190703/f9534b79/attachment.html>


More information about the llvm-dev mailing list