eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsChecker.py

changeset 8222
5994b80b8760
parent 8218
7c09585bd960
child 8236
695777f04b25
equal deleted inserted replaced
8221:0572a215bd2f 8222:5994b80b8760
369 @type str 369 @type str
370 @param methodType type of method/function the argument belongs to 370 @param methodType type of method/function the argument belongs to
371 @type str 371 @type str
372 """ 372 """
373 # check class method issues 373 # check class method issues
374 if methodType != "function": 374 if methodType != "function" and argNode.arg in ("cls", "self"):
375 if argNode.arg in ("cls", "self"): 375 if methodType == "classmethod":
376 if methodType == "classmethod": 376 self.issues.append((argNode, "A102"))
377 self.issues.append((argNode, "A102")) 377 return
378 return 378 elif methodType != "staticmethod":
379 elif methodType != "staticmethod": 379 self.issues.append((argNode, "A101"))
380 self.issues.append((argNode, "A101")) 380 return
381 return
382 381
383 # check all other arguments 382 # check all other arguments
384 if argType == "kwarg": 383 if argType == "kwarg":
385 self.issues.append((argNode, "A003", argNode.arg)) 384 self.issues.append((argNode, "A003", argNode.arg))
386 elif argType == "vararg": 385 elif argType == "vararg":

eric ide

mercurial