summaryrefslogtreecommitdiffstats
path: root/src/docparser.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2015-12-26 14:29:39 (GMT)
committeralbert-github <albert.tests@gmail.com>2015-12-26 14:29:39 (GMT)
commit0a5dfb77a7d0dfaac2baf8f3e61014a29ba2883b (patch)
tree65f4af233361f0baee0dd08c7a4a3a660b091fd0 /src/docparser.cpp
parent165498dc9ea33bc9991c5ab5234b5e51d74569d0 (diff)
downloadDoxygen-0a5dfb77a7d0dfaac2baf8f3e61014a29ba2883b.zip
Doxygen-0a5dfb77a7d0dfaac2baf8f3e61014a29ba2883b.tar.gz
Doxygen-0a5dfb77a7d0dfaac2baf8f3e61014a29ba2883b.tar.bz2
Bug 735152 - Python: Allow undocumented "cls" parameter for class methods
Made 'cls' parameter analogous to the 'self' parameter. See also https://www.python.org/dev/peps/pep-0008 (paragraph: Function and method arguments)
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r--src/docparser.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index b706c9b..099213d 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -471,9 +471,9 @@ static void checkUndocumentedParams()
if (lang==SrcLangExt_Fortran) argName = argName.lower();
argName=argName.stripWhiteSpace();
if (argName.right(3)=="...") argName=argName.left(argName.length()-3);
- if (g_memberDef->getLanguage()==SrcLangExt_Python && argName=="self")
+ if (g_memberDef->getLanguage()==SrcLangExt_Python && (argName=="self" || argName=="cls"))
{
- // allow undocumented self parameter for Python
+ // allow undocumented self / cls parameter for Python
}
else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a->docs.isEmpty())
{
@@ -494,9 +494,9 @@ static void checkUndocumentedParams()
QCString argName = g_memberDef->isDefine() ? a->type : a->name;
if (lang==SrcLangExt_Fortran) argName = argName.lower();
argName=argName.stripWhiteSpace();
- if (g_memberDef->getLanguage()==SrcLangExt_Python && argName=="self")
+ if (g_memberDef->getLanguage()==SrcLangExt_Python && (argName=="self" || argName=="cls"))
{
- // allow undocumented self parameter for Python
+ // allow undocumented self / cls parameter for Python
}
else if (!argName.isEmpty() && g_paramsFound.find(argName)==0)
{
@@ -554,7 +554,7 @@ static void detectNoDocumentedParams()
for (ali.toFirst();(a=ali.current()) && allDoc;++ali)
{
if (!a->name.isEmpty() && a->type!="void" &&
- !(isPython && a->name=="self")
+ !(isPython && (a->name=="self" || a->name=="cls"))
)
{
allDoc = !a->docs.isEmpty();
@@ -570,7 +570,7 @@ static void detectNoDocumentedParams()
for (ali.toFirst();(a=ali.current()) && allDoc;++ali)
{
if (!a->name.isEmpty() && a->type!="void" &&
- !(isPython && a->name=="self")
+ !(isPython && (a->name=="self" || a->name=="cls"))
)
{
allDoc = !a->docs.isEmpty();