[cfe-dev] Fwd: Running Clang-Tidy on a Large Project

Ahmad Nouralizadeh via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 19 04:25:16 PDT 2018


I ran clang-tidy in the root directory of the source code of an application
(MPlayer-1.3.0). Precisely, I use run-clang-tidy.py python script, as
follows:

run-clang-tidy.py -header-filter='.*'
-checks='-*,readability-braces-around-statements' -fix


I ran clang-tidy in the root directory of the source code of an application
(MPlayer-1.3.0). Precisely, I use run-clang-tidy.py python script, as
follows:

run-clang-tidy.py -header-filter='.*'
-checks='-*,readability-braces-around-statements' -fix

The commands database is also stored in the root directory in a file named
compile_commands.json. After gathering all fixes, it tries to apply them
but no fix is applied on any of the source files compiled from the
*inner* directories.
Here is the first part of the error report:

Applying fixes ...Described file './libavutil/internal.h' doesn't
exist. Ignoring...Described file './libavutil/x86/intmath.h' doesn't
exist. Ignoring...Described file 'libavformat/internal.h' doesn't
exist. Ignoring...Described file './libavcodec/bytestream.h' doesn't
exist. Ignoring...Described file './libavcodec/flac.h' doesn't exist.
Ignoring...Described file './libavcodec/get_bits.h' doesn't exist.
Ignoring...Described file './libavcodec/internal.h' doesn't exist.
Ignoring...Described file './libavcodec/mathops.h' doesn't exist.
Ignoring...Described file './libavcodec/put_bits.h' doesn't exist.
Ignoring...Described file 'libavformat/matroskaenc.c' doesn't exist.
Ignoring...Described file 'libavformat/subtitles.h' doesn't exist.
Ignoring...Described file 'libavformat/apngdec.c' doesn't exist.
Ignoring......

These files are compiled using the Makefile located in the folder ffmpeg.
For example, libavformat/apngdec.c is located at ./ffmpeg/libavformat/
apngdec.c where .is the root directory of MPlayer-1.3.0. How can I fix the
problem?
It seems that the fixes exported in yaml format stored relative paths.
These paths are imported to clang-apply-replacemens which can not recognize
the correct prefix for them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180719/327b7242/attachment.html>


More information about the cfe-dev mailing list