Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py

changeset 5898
fc96d49f5fbf
parent 5815
223fa32b3a32
child 6048
82ad8ec9548c
equal deleted inserted replaced
5897:ae17b1ae12bb 5898:fc96d49f5fbf
1137 # extract @param and @keyparam from docstring 1137 # extract @param and @keyparam from docstring
1138 args = [] 1138 args = []
1139 kwargs = [] 1139 kwargs = []
1140 for line in docstringContext.source(): 1140 for line in docstringContext.source():
1141 if line.strip().startswith(("@param", "@keyparam")): 1141 if line.strip().startswith(("@param", "@keyparam")):
1142 at, name = line.strip().split(None, 2)[:2] 1142 paramParts = line.strip().split(None, 2)
1143 if at == "@keyparam": 1143 if len(paramParts) >= 2:
1144 kwargs.append(name.lstrip("*")) 1144 at, name = paramParts[:2]
1145 args.append(name.lstrip("*")) 1145 if at == "@keyparam":
1146 kwargs.append(name.lstrip("*"))
1147 args.append(name.lstrip("*"))
1146 1148
1147 # do the checks 1149 # do the checks
1148 for name in kwNames: 1150 for name in kwNames:
1149 if name not in kwargs: 1151 if name not in kwargs:
1150 self.__error(docstringContext.end(), 0, "D238") 1152 self.__error(docstringContext.end(), 0, "D238")

eric ide

mercurial