GNATHub Issue - Database doesn't associate errors with sources from imported projects

Hello everyone, I’m encountering an issue with GNATHub not properly analyzing all files in a nested project structure.

When I run gnathub -Pgnatcheck_example.gpr --plugins gnatcheck -v, GNATHub only associates issues with the main.adb file in its final database obj/gnathub/gnathub.db, but completely ignores those from the library files (pack.adb and pack.ads).

However, I verified that gnatcheck itself correctly detects issues for all files (table messages correctly completed in the database). The problem seems to be in the downstream step that processes the messages and associates them with resources in the database (table resources_messages).

If I move all source files into a single src directory, the complete analysis works correctly for all files.

I should mention that the gnatcheck_example project is based on the official documentation example. I’ve simply moved the pack code into an imported project to create a more modular structure.

Question

Is this a limitation of GNATHub not analyzing files from imported projects, or is there a special configuration to use for nested projects? Am I missing something obvious in how to set up GNATHub for analyzing code across multiple project files?

Project Structure Details

For reference, here’s my project structure (details of the GPR files provided below):

.
├── gnatcheck_example.gpr    (main project)
├── lib
│   ├── pack.gpr             (library project)
│   └── src
│       ├── pack.adb
│       └── pack.ads
└── src
    └── main.adb

gnatcheck_example.gpr:

with "lib/pack";
project Gnatcheck_Example is
   for Source_Dirs use ("src");
   for Object_Dir use "obj";
   for Main use ("main.adb");
end Gnatcheck_Example;

Thanks in advance for your help

I found the solution by slightly modifying the gnatcheck plugin.

It was necessary to execute gnatcheck with the -l option to analyze files using their full paths.

Consequently, I had to make minor modifications to the python gnatcheck plugin code, specifically updating the regular expressions for parsing, particularly SLOC_PATTERN.