bin/find-unneeded-includes |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit c765ee9d1a241d4f11112740f44aa74c1a7792dc
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Wed Jan 28 09:22:36 2026 +0100
Commit:     Gabor Kelemen <[email protected]>
CommitDate: Wed Jan 28 16:53:01 2026 +0100

    bin/find-unneeded-includes: check if hdl files are considered necessary
    
    spotted while rechecking include/toolkit, some hpp headers are now
    not suggested to be replaced by fw declarations incorrectly,
    but to be replaced by their matching hdl files.
    
    There is already a rule to skip these automatically, no need to keep such
    in exception files
    
    Change-Id: I5df654a9bca3aaaecb4dce444264a6464ca8f3b3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198277
    Tested-by: Jenkins
    Reviewed-by: Gabor Kelemen <[email protected]>

diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index fb5edfb103fd..99b69b2ded65 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -261,6 +261,13 @@ def processIWYUOutput(iwyuOutput, moduleRules, fileName, 
noexclude, checknamespa
                 if realFileName in excludelistRules.keys():
                     if include in excludelistRules[realFileName]:
                         print("WARNING:", include, "excluded header can be 
removed from exclusion list of file:", realFileName)
+                    # check if a hpp files hdl pair is now considered necessary
+                    # then there is no need for an explicit exclusion
+                    hdlMatch = re.match(".*.hdl", include)
+                    if hdlMatch:
+                        hdl = include.replace(".hdl", ".hpp")
+                        if hdl in excludelistRules[realFileName]:
+                            print("WARNING:", hdl, "excluded header can be 
removed from exclusion list of file:", realFileName)
 
             if checknamespaces:
                 # match for all possible URE/UNO namespaces, created with:

Reply via email to