Skip to content

Commit

Permalink
Check for undocumented params warnings if members detailed documentat…
Browse files Browse the repository at this point in the history
…ion is not written
  • Loading branch information
artur-kink committed Nov 29, 2016
1 parent 6a85240 commit bae3c91
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
47 changes: 27 additions & 20 deletions src/memberdef.cpp
Expand Up @@ -3013,26 +3013,7 @@ void MemberDef::writeDocumentation(MemberList *ml,
//if (Config_getBool(EXTRACT_ALL) && !hasDocs) ol.enable(OutputGenerator::Latex);
ol.popGeneratorState();

//------------------------------------------------

if (!Config_getBool(EXTRACT_ALL) &&
Config_getBool(WARN_IF_UNDOCUMENTED) &&
Config_getBool(WARN_NO_PARAMDOC) &&
!Doxygen::suppressDocWarnings)
{
if (!hasDocumentedParams())
{
warn_doc_error(getDefFileName(),getDefLine(),
"parameters of member %s are not (all) documented",
qPrint(qualifiedName()));
}
if (!hasDocumentedReturnType() && isFunction() && hasDocumentation())
{
warn_doc_error(getDefFileName(),getDefLine(),
"return type of member %s is not documented",
qPrint(qualifiedName()));
}
}
warnIfUndocumentedParams();
}

// strip scope and field name from the type
Expand Down Expand Up @@ -3267,9 +3248,35 @@ void MemberDef::warnIfUndocumented()
warn_undoc(getDefFileName(),getDefLine(),"Member %s%s (%s) of %s %s is not documented.",
qPrint(name()),qPrint(argsString()),qPrint(memberTypeName()),t,qPrint(d->name()));
}
else if (!isDetailedSectionLinkable())
{
warnIfUndocumentedParams();
}
}


void MemberDef::warnIfUndocumentedParams()
{
if (!Config_getBool(EXTRACT_ALL) &&
Config_getBool(WARN_IF_UNDOCUMENTED) &&
Config_getBool(WARN_NO_PARAMDOC) &&
!Doxygen::suppressDocWarnings)
{
if (!hasDocumentedParams())
{
warn_doc_error(getDefFileName(),getDefLine(),
"parameters of member %s are not (all) documented",
qPrint(qualifiedName()));
}
if (!hasDocumentedReturnType() &&
isFunction() && hasDocumentation())
{
warn_doc_error(getDefFileName(),getDefLine(),
"return type of member %s is not documented",
qPrint(qualifiedName()));
}
}
}

bool MemberDef::isFriendClass() const
{
Expand Down
1 change: 1 addition & 0 deletions src/memberdef.h
Expand Up @@ -389,6 +389,7 @@ class MemberDef : public Definition
ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd);
void writeTagFile(FTextStream &);
void warnIfUndocumented();
void warnIfUndocumentedParams();

MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs,
ArgumentList *actualArgs);
Expand Down

0 comments on commit bae3c91

Please sign in to comment.