Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py

changeset 2984
031cceaa8b01
parent 2982
556adfe76ba7
child 3004
c4bf32c791d0
equal deleted inserted replaced
2983:f2f33024b001 2984:031cceaa8b01
2 2
3 # Copyright (c) 2013 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2013 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing a checker for PEP-257 documentation string conventions. 7 Module implementing a checker for documentation string conventions.
8 """ 8 """
9 9
10 # 10 #
11 # The routines of the checker class are modeled after the ones found in 11 # The routines of the checker class are modeled after the ones found in
12 # pep257.py (version 0.2.4). 12 # pep257.py (version 0.2.4).
100 return self.__type 100 return self.__type
101 101
102 102
103 class DocStyleChecker(object): 103 class DocStyleChecker(object):
104 """ 104 """
105 Class implementing a checker for PEP-257 documentation string conventions. 105 Class implementing a checker for documentation string conventions.
106 """ 106 """
107 Codes = [ 107 Codes = [
108 "D101", "D102", "D103", "D104", "D105", 108 "D101", "D102", "D103", "D104", "D105",
109 "D111", "D112", "D113", 109 "D111", "D112", "D113",
110 "D121", "D122", 110 "D121", "D122",
427 return self.__source[self.__lineNumber - 1] 427 return self.__source[self.__lineNumber - 1]
428 428
429 def run(self): 429 def run(self):
430 """ 430 """
431 Public method to check the given source for violations of doc string 431 Public method to check the given source for violations of doc string
432 conventions according to PEP-257. 432 conventions.
433 """ 433 """
434 if not self.__source or not self.__filename: 434 if not self.__source or not self.__filename:
435 # don't do anything, if essential data is missing 435 # don't do anything, if essential data is missing
436 return 436 return
437 437

eric ide

mercurial