[QGIS-Developer] Clang-Tidy failing by not finding qgis_test.h

Julien Cabieces julien.cabieces at oslandia.com
Fri Feb 17 07:46:03 PST 2023


Hi Sandro, 

> Upon adding a macro to src/test/qgstest.h the "clang-tidy" github
> workflow started failing by not finding "qgis_test.h" which is a
> generated header file.
>
> The last change in src/test/qgstest.h was committed in August 2022
> while the "clang-tidy" github workfow entered the codebase in
> September 2022. My guess is that code never run for real, but I could
> be wrong.

clang-tidy run on only modified files and lines because it would be way to long to
run on the whole code base. So that's not very a surprise. The idea is
to have the new modification clang-tidy-ready.

>
> Is there any way to run the clang-tidy locally ?
>

At the end of the failing job, you have the following instructions

To reproduce locally:
 - launch cmake with option -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
 - update build by calling Ninja
 - launch command ./scripts/clang-tidy.sh -p <your_build_dir> <source_file>

> Julien: as the one who added that workflow, can you help me get the
> CI part solved as it's blaming me for something I don't seem to be
> responsible for ?
>

I take a quick look:
- qgis_test.h exists in the build artefact
- the folder is included for testqgspostgresconn in
compile_commands.json, 

So everything looks good. My code completion/navigation tool based on LSP/clang
print me an error also and, like clang-tidy, it relies on
compile_commands.json.

So far,  I don't know why there is an error and I don't have time for
more investigation now.

I'm away from keyboard for a week, I can take a look when I come back.

If you don't want to wait and want the PR to be merged, you can bypass
the failing job, I'll try to figure out what the problem is later.

Regards,
Julien


> --strk;
>
>   Libre GIS consultant/developer
>   https://strk.kbt.io/services.html


-- 

Julien Cabieces
Senior Developer at Oslandia
julien.cabieces at oslandia.com
09.72.52.52.76


More information about the QGIS-Developer mailing list