Skip to content

Commit

Permalink
Submit warning when the ingroup command is used with an non-existing …
Browse files Browse the repository at this point in the history
…group name (2)

Analogous to #10289 also give warnings when the `\ingroup` command is given with a non existing group name for namespaces / classes / ...
  • Loading branch information
albert-github committed Oct 11, 2023
1 parent 73874de commit 9777be4
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/doxygen.cpp
Expand Up @@ -528,6 +528,13 @@ static void buildFileList(const Entry *root)
//printf("File %s: in group %s\n",qPrint(fd->name()),qPrint(gd->name()));
}
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}
}
else
Expand Down Expand Up @@ -7457,6 +7464,13 @@ static bool tryAddEnumDocsToGroupMember(const Entry *root,const QCString &name)
}
}
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}

return FALSE;
Expand Down
55 changes: 53 additions & 2 deletions src/groupdef.cpp
Expand Up @@ -1411,7 +1411,8 @@ void addClassToGroups(const Entry *root,ClassDef *cd)
{
for (const Grouping &g : root->groups)
{
GroupDef *gd = Doxygen::groupLinkedMap->find(g.groupname);
GroupDef *gd=0;
if (!g.groupname.isEmpty()) gd=Doxygen::groupLinkedMap->find(g.groupname);
if (gd && gd->addClass(cd))
{
ClassDefMutable *cdm = toClassDefMutable(cd);
Expand All @@ -1421,6 +1422,13 @@ void addClassToGroups(const Entry *root,ClassDef *cd)
}
//printf("Compound %s: in group %s\n",qPrint(cd->name()),gd->groupTitle());
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}
}

Expand All @@ -1438,6 +1446,13 @@ void addConceptToGroups(const Entry *root,ConceptDef *cd)
}
//printf("Compound %s: in group %s\n",qPrint(cd->name()),gd->groupTitle());
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}
}

Expand All @@ -1451,6 +1466,13 @@ void addModuleToGroups(const Entry *root,ModuleDef *mod)
mod->makePartOfGroup(gd);
//printf("Module %s: in group %s\n",qPrint(mod->name()),gd->groupTitle());
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}
}

Expand All @@ -1460,7 +1482,8 @@ void addNamespaceToGroups(const Entry *root,NamespaceDef *nd)
//printf("root->groups.size()=%zu\n",root->groups.size());
for (const Grouping &g : root->groups)
{
GroupDef *gd = Doxygen::groupLinkedMap->find(g.groupname);
GroupDef *gd=0;
if (!g.groupname.isEmpty()) gd=Doxygen::groupLinkedMap->find(g.groupname);
//printf("group '%s' gd=%p\n",qPrint(g.groupname),(void*)gd);
if (gd && gd->addNamespace(nd))
{
Expand All @@ -1471,6 +1494,13 @@ void addNamespaceToGroups(const Entry *root,NamespaceDef *nd)
}
//printf("Namespace %s: in group %s\n",qPrint(nd->name()),qPrint(gd->name()));
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}
}

Expand All @@ -1487,6 +1517,13 @@ void addDirToGroups(const Entry *root,DirDef *dd)
dd->makePartOfGroup(gd);
//printf("Dir %s: in group %s\n",qPrint(dd->name()),qPrint(g->groupname));
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}
}

Expand Down Expand Up @@ -1514,6 +1551,13 @@ void addGroupToGroups(const Entry *root,GroupDef *subGroup)
subGroup->makePartOfGroup(gd);
}
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}
}

Expand Down Expand Up @@ -1655,6 +1699,13 @@ void addExampleToGroups(const Entry *root,PageDef *eg)
eg->makePartOfGroup(gd);
//printf("Example %s: in group %s\n",qPrint(eg->name()),s->data());
}
else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
{
warn(root->fileName, root->startLine,
"Found non-existing group '%s' for the command '%s', ignoring command",
qPrint(g.groupname), Grouping::getGroupPriName( g.pri )
);
}
}
}

Expand Down

0 comments on commit 9777be4

Please sign in to comment.