UtilitiesPython2/DocStyleCheckerPy2.py

changeset 2984
031cceaa8b01
parent 2983
f2f33024b001
child 3031
ed2eaa573ca5
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).
98 return self.__type 98 return self.__type
99 99
100 100
101 class DocStyleChecker(object): 101 class DocStyleChecker(object):
102 """ 102 """
103 Class implementing a checker for PEP-257 and eric documentation string conventions. 103 Class implementing a checker for documentation string conventions.
104 """ 104 """
105 Codes = [ 105 Codes = [
106 "D101", "D102", "D103", "D104", "D105", 106 "D101", "D102", "D103", "D104", "D105",
107 "D111", "D112", "D113", 107 "D111", "D112", "D113",
108 "D121", "D122", 108 "D121", "D122",
292 return self.__source[self.__lineNumber - 1] 292 return self.__source[self.__lineNumber - 1]
293 293
294 def run(self): 294 def run(self):
295 """ 295 """
296 Public method to check the given source for violations of doc string 296 Public method to check the given source for violations of doc string
297 conventions according to PEP-257. 297 conventions.
298 """ 298 """
299 if not self.__source or not self.__filename: 299 if not self.__source or not self.__filename:
300 # don't do anything, if essential data is missing 300 # don't do anything, if essential data is missing
301 return 301 return
302 302

eric ide

mercurial