Skip to content

Commit

Permalink
Improve warning location for undocumented parameters/return types
Browse files Browse the repository at this point in the history
Warning could point at a header while the documentation block with the
problem was located in a source file.
  • Loading branch information
doxygen committed Dec 26, 2021
1 parent ababe4c commit 2b4e688
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/docparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ void DocParser::checkUnOrMultipleDocumentedParams()
}
else if (count>1 && Config_getBool(WARN_IF_DOC_ERROR))
{
warn_doc_error(context.memberDef->getDefFileName(),
context.memberDef->getDefLine(),
warn_doc_error(context.memberDef->docFile(),
context.memberDef->docLine(),
"%s",
qPrint("argument '" + aName +
"' from the argument list of " +
Expand All @@ -541,8 +541,8 @@ void DocParser::checkUnOrMultipleDocumentedParams()
first=FALSE;
errMsg+=" parameter '"+argName+"'";
}
warn_incomplete_doc(context.memberDef->getDefFileName(),
context.memberDef->getDefLine(),
warn_incomplete_doc(context.memberDef->docFile(),
context.memberDef->docLine(),
"%s",
qPrint(substitute(errMsg,"%","%%")));
}
Expand Down
6 changes: 3 additions & 3 deletions src/memberdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4006,7 +4006,7 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn
)
{

warn_doc_error(getDefFileName(),getDefLine(),"documented empty return type of %s",
warn_doc_error(docFile(),docLine(),"documented empty return type of %s",
qPrint(qualifiedName()));
}
else if ( // see if return needs to documented
Expand Down Expand Up @@ -4034,14 +4034,14 @@ void MemberDefImpl::warnIfUndocumentedParams() const
QCString returnType = typeString();
if (!m_impl->hasDocumentedParams)
{
warn_doc_error(getDefFileName(),getDefLine(),
warn_doc_error(docFile(),docLine(),
"parameters of member %s are not (all) documented",
qPrint(qualifiedName()));
}
if (!m_impl->hasDocumentedReturnType &&
hasDocumentation() && !returnType.isEmpty())
{
warn_doc_error(getDefFileName(),getDefLine(),
warn_doc_error(docFile(),docLine(),
"return type of member %s is not documented",
qPrint(qualifiedName()));
}
Expand Down

0 comments on commit 2b4e688

Please sign in to comment.