Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py

changeset 5898
fc96d49f5fbf
parent 5815
223fa32b3a32
child 6048
82ad8ec9548c
--- a/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py	Sun Oct 08 13:28:23 2017 +0200
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py	Mon Oct 09 19:06:46 2017 +0200
@@ -1139,10 +1139,12 @@
                 kwargs = []
                 for line in docstringContext.source():
                     if line.strip().startswith(("@param", "@keyparam")):
-                        at, name = line.strip().split(None, 2)[:2]
-                        if at == "@keyparam":
-                            kwargs.append(name.lstrip("*"))
-                        args.append(name.lstrip("*"))
+                        paramParts = line.strip().split(None, 2)
+                        if len(paramParts) >= 2:
+                            at, name = paramParts[:2]
+                            if at == "@keyparam":
+                                kwargs.append(name.lstrip("*"))
+                            args.append(name.lstrip("*"))
                 
                 # do the checks
                 for name in kwNames:

eric ide

mercurial