Clang-Tidy Problem when Exporting Fixes

Ahmad Nouralizadeh via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 21 13:30:05 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.
This is because the compilation database generated using Bear is in
that format. The paths should become absolute before being exported to
yaml, similar to what is done at
"clang-tools-extra-6.0.0/clang-tidy/ClangTidy.cpp:Line131".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180722/46485404/attachment.html>


More information about the cfe-commits mailing list