OLD | NEW |
---|---|
1 # lint Python modules using external checkers. | |
M-A Ruel
2013/02/27 21:40:08
Remove this file, setup, requirements, tests/, any
| |
2 # | |
3 # This is the main checker controlling the other ones and the reports | |
4 # generation. It is itself both a raw checker and an astng checker in order | |
5 # to: | |
6 # * handle message activation / deactivation at the module level | |
7 # * handle some basic but necessary stats'data (number of classes, methods...) | |
8 # | |
1 [MASTER] | 9 [MASTER] |
2 | 10 |
11 | |
3 # Specify a configuration file. | 12 # Specify a configuration file. |
4 #rcfile= | 13 #rcfile= |
5 | 14 |
6 # Python code to execute, usually for sys.path manipulation such as | |
7 # pygtk.require(). | |
8 #init-hook= | |
9 | |
10 # Profiled execution. | 15 # Profiled execution. |
11 profile=no | 16 profile=no |
12 | 17 |
13 # Add files or directories to the blacklist. They should be base names, not | 18 # Add <file or directory> to the black list. It should be a base name, not a |
14 # paths. | 19 # path. You may set this option multiple times. |
15 ignore=CVS | 20 ignore=.svn |
16 | 21 |
17 # Pickle collected data for later comparisons. | 22 # Pickle collected data for later comparisons. |
18 persistent=yes | 23 persistent=yes |
19 | 24 |
25 # Set the cache size for astng objects. | |
26 cache-size=500 | |
27 | |
20 # List of plugins (as comma separated values of python modules names) to load, | 28 # List of plugins (as comma separated values of python modules names) to load, |
21 # usually to register additional checkers. | 29 # usually to register additional checkers. |
22 load-plugins= | 30 load-plugins= |
23 | 31 |
24 | 32 |
25 [MESSAGES CONTROL] | 33 [MESSAGES CONTROL] |
26 | 34 |
27 # Enable the message, report, category or checker with the given id(s). You can | 35 # Enable only checker(s) with the given id(s). This option conflict with the |
28 # either give multiple identifier separated by comma (,) or put this option | 36 # disable-checker option |
29 # multiple time. | 37 #enable-checker= |
30 #enable= | |
31 | 38 |
32 # Disable the message, report, category or checker with the given id(s). You | 39 # Enable all checker(s) except those with the given id(s). This option conflict |
33 # can either give multiple identifier separated by comma (,) or put this option | 40 # with the disable-checker option |
34 # multiple time (only on the command line, not in the configuration file where | 41 #disable-checker= |
35 # it should appear only once). | |
36 # CHANGED: | |
37 # C0103: Invalid name "" | |
38 # C0111: Missing docstring | |
39 # C0302: Too many lines in module (N) | |
40 # I0010: Unable to consider inline option '' | |
41 # I0011: Locally disabling WNNNN | |
42 # | |
43 # R0801: Similar lines in N files | |
44 # R0901: Too many ancestors (8/7) | |
45 # R0902: Too many instance attributes (N/7) | |
46 # R0903: Too few public methods (N/2) | |
47 # R0904: Too many public methods (N/20) | |
48 # R0911: Too many return statements (N/6) | |
49 # R0912: Too many branches (N/12) | |
50 # R0913: Too many arguments (N/5) | |
51 # R0914: Too many local variables (N/15) | |
52 # R0915: Too many statements (N/50) | |
53 # R0921: Abstract class not referenced | |
54 # R0922: Abstract class is only referenced 1 times | |
55 # W0122: Use of the exec statement | |
56 # W0141: Used builtin function '' | |
57 # W0142: Used * or ** magic | |
58 # W0402: Uses of a deprecated module 'string' | |
59 # W0404: 41: Reimport 'XX' (imported line NN) | |
60 # W0511: TODO | |
61 # W0603: Using the global statement | |
62 # W0703: Catch "Exception" | |
63 # W1201: Specify string format arguments as logging function parameters | |
64 disable=C0103,C0111,C0302,I0010,I0011,R0801,R0901,R0902,R0903,R0904,R0911,R0912, R0913,R0914,R0915,R0921,R0922,W0122,W0141,W0142,W0402,W0404,W0511,W0603,W0703,W1 201 | |
65 | 42 |
43 # Enable all messages in the listed categories. | |
44 #enable-msg-cat= | |
45 | |
46 # Disable all messages in the listed categories. | |
47 #disable-msg-cat= | |
48 | |
49 # Enable the message(s) with the given id(s). | |
50 #enable-msg= | |
51 | |
52 # Disable the message(s) with the given id(s). | |
53 # disable-msg=C0323,W0142,C0301,C0103,C0111,E0213,C0302,C0203,W0703,R0201 | |
54 disable-msg=C0111,C0103,W0703,W0702 | |
66 | 55 |
67 [REPORTS] | 56 [REPORTS] |
68 | 57 |
69 # Set the output format. Available formats are text, parseable, colorized, msvs | 58 # set the output format. Available formats are text, parseable, colorized and |
70 # (visual studio) and html | 59 # html |
71 output-format=text | 60 output-format=colorized |
72 | 61 |
73 # Include message's id in output | 62 # Include message's id in output |
74 include-ids=yes | 63 include-ids=yes |
75 | 64 |
76 # Put messages in a separate file for each module / package specified on the | 65 # Put messages in a separate file for each module / package specified on the |
77 # command line instead of printing them on stdout. Reports (if any) will be | 66 # command line instead of printing them on stdout. Reports (if any) will be |
78 # written in a file name "pylint_global.[txt|html]". | 67 # written in a file name "pylint_global.[txt|html]". |
79 files-output=no | 68 files-output=no |
80 | 69 |
81 # Tells whether to display a full report or only the messages | 70 # Tells wether to display a full report or only the messages |
82 # CHANGED: | 71 reports=yes |
83 reports=no | |
84 | 72 |
85 # Python expression which should return a note less than 10 (10 is the highest | 73 # Python expression which should return a note less than 10 (10 is the highest |
86 # note). You have access to the variables errors warning, statement which | 74 # note).You have access to the variables errors warning, statement which |
87 # respectively contain the number of errors / warnings messages and the total | 75 # respectivly contain the number of errors / warnings messages and the total |
88 # number of statements analyzed. This is used by the global evaluation report | 76 # number of statements analyzed. This is used by the global evaluation report |
89 # (RP0004). | 77 # (R0004). |
90 evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / stateme nt) * 10) | 78 evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / stateme nt) * 10) |
91 | 79 |
92 # Add a comment according to your evaluation note. This is used by the global | 80 # Add a comment according to your evaluation note. This is used by the global |
93 # evaluation report (RP0004). | 81 # evaluation report (R0004). |
94 comment=no | 82 comment=no |
95 | 83 |
84 # Enable the report(s) with the given id(s). | |
85 #enable-report= | |
96 | 86 |
87 # Disable the report(s) with the given id(s). | |
88 #disable-report= | |
89 | |
90 # checks for | |
91 # * unused variables / imports | |
92 # * undefined variables | |
93 # * redefinition of variable from builtins or from an outer scope | |
94 # * use of variable before assigment | |
95 # | |
97 [VARIABLES] | 96 [VARIABLES] |
98 | 97 |
99 # Tells whether we should check for unused import in __init__ files. | 98 # Tells wether we should check for unused import in __init__ files. |
100 init-import=no | 99 init-import=yes |
101 | 100 |
102 # A regular expression matching the beginning of the name of dummy variables | 101 # A regular expression matching names used for dummy variables (i.e. not used). |
103 # (i.e. not used). | |
104 dummy-variables-rgx=_|dummy | 102 dummy-variables-rgx=_|dummy |
105 | 103 |
106 # List of additional names supposed to be defined in builtins. Remember that | 104 # List of additional names supposed to be defined in builtins. Remember that |
107 # you should avoid to define new builtins when possible. | 105 # you should avoid to define new builtins when possible. |
108 additional-builtins= | 106 additional-builtins= |
109 | 107 |
110 | 108 |
109 # try to find bugs in the code using type inference | |
110 # | |
111 [TYPECHECK] | 111 [TYPECHECK] |
112 | 112 |
113 # Tells whether missing members accessed in mixin class should be ignored. A | 113 # Tells wether missing members accessed in mixin class should be ignored. A |
114 # mixin class is detected if its name ends with "mixin" (case insensitive). | 114 # mixin class is detected if its name ends with "mixin" (case insensitive). |
115 ignore-mixin-members=yes | 115 ignore-mixin-members=yes |
116 | 116 |
117 # List of classes names for which member attributes should not be checked | 117 # When zope mode is activated, consider the acquired-members option to ignore |
118 # (useful for classes with attributes dynamically set). | 118 # access to some undefined attributes. |
119 ignored-classes=SQLObject,twisted.internet.reactor,hashlib,google.appengine.api. memcache | |
120 | |
121 # When zope mode is activated, add a predefined set of Zope acquired attributes | |
122 # to generated-members. | |
123 zope=no | 119 zope=no |
124 | 120 |
125 # List of members which are set dynamically and missed by pylint inference | 121 # List of members which are usually get through zope's acquisition mecanism and |
126 # system, and so shouldn't trigger E0201 when accessed. Python regular | 122 # so shouldn't trigger E0201 when accessed (need zope=yes to be considered). |
127 # expressions are accepted. | 123 acquired-members=REQUEST,acl_users,aq_parent |
128 generated-members=REQUEST,acl_users,aq_parent,multiprocessing.managers.SyncManag er | |
129 | 124 |
130 | 125 |
131 [MISCELLANEOUS] | 126 # checks for : |
132 | 127 # * doc strings |
133 # List of note tags to take in consideration, separated by a comma. | 128 # * modules / classes / functions / methods / arguments / variables name |
134 notes=FIXME,XXX,TODO | 129 # * number of arguments, local variables, branches, returns and statements in |
135 | 130 # functions, methods |
136 | 131 # * required module attributes |
137 [SIMILARITIES] | 132 # * dangerous default values as arguments |
138 | 133 # * redefinition of function / method / class |
139 # Minimum lines number of a similarity. | 134 # * uses of the global statement |
140 min-similarity-lines=4 | 135 # |
141 | |
142 # Ignore comments when computing similarities. | |
143 ignore-comments=yes | |
144 | |
145 # Ignore docstrings when computing similarities. | |
146 ignore-docstrings=yes | |
147 | |
148 | |
149 [FORMAT] | |
150 | |
151 # Maximum number of characters on a single line. | |
152 max-line-length=80 | |
153 | |
154 # Maximum number of lines in a module | |
155 max-module-lines=1000 | |
156 | |
157 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 | |
158 # tab). | |
159 # CHANGED: | |
160 indent-string=' ' | |
161 | |
162 | |
163 [BASIC] | 136 [BASIC] |
164 | 137 |
165 # Required attributes for module, separated by a comma | 138 # Required attributes for module, separated by a comma |
166 required-attributes= | 139 required-attributes= |
167 | 140 |
168 # List of builtins function names that should not be used, separated by a comma | 141 # Regular expression which should only match functions or classes name which do |
169 bad-functions=map,filter,apply,input | 142 # not require a docstring |
143 no-docstring-rgx=__.*__ | |
170 | 144 |
171 # Regular expression which should only match correct module names | 145 # Regular expression which should only match correct module names |
172 module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ | 146 module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ |
173 | 147 |
174 # Regular expression which should only match correct module level names | 148 # Regular expression which should only match correct module level names |
175 const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ | 149 const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))$ |
176 | 150 |
177 # Regular expression which should only match correct class names | 151 # Regular expression which should only match correct class names |
178 class-rgx=[A-Z_][a-zA-Z0-9]+$ | 152 class-rgx=[A-Z_][a-zA-Z0-9]+$ |
179 | 153 |
180 # Regular expression which should only match correct function names | 154 # Regular expression which should only match correct function names |
181 function-rgx=[a-z_][a-z0-9_]{2,30}$ | 155 function-rgx=[a-z_][a-z0-9_]{2,30}$ |
182 | 156 |
183 # Regular expression which should only match correct method names | 157 # Regular expression which should only match correct method names |
184 method-rgx=[a-z_][a-z0-9_]{2,30}$ | 158 method-rgx=[a-z_][a-z0-9_]{2,30}$ |
185 | 159 |
186 # Regular expression which should only match correct instance attribute names | 160 # Regular expression which should only match correct instance attribute names |
187 attr-rgx=[a-z_][a-z0-9_]{2,30}$ | 161 attr-rgx=[a-z_][a-z0-9_]{2,30}$ |
188 | 162 |
189 # Regular expression which should only match correct argument names | 163 # Regular expression which should only match correct argument names |
190 argument-rgx=[a-z_][a-z0-9_]{2,30}$ | 164 argument-rgx=[a-z_][a-z0-9_]{2,30}$ |
191 | 165 |
192 # Regular expression which should only match correct variable names | 166 # Regular expression which should only match correct variable names |
193 variable-rgx=[a-z_][a-z0-9_]{2,30}$ | 167 variable-rgx=[a-z_][a-z0-9_]{2,30}$ |
194 | 168 |
195 # Regular expression which should only match correct list comprehension / | 169 # Regular expression which should only match correct list comprehension / |
196 # generator expression variable names | 170 # generator expression variable names |
197 inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ | 171 inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ |
198 | 172 |
199 # Good variable names which should always be accepted, separated by a comma | 173 # Good variable names which should always be accepted, separated by a comma |
200 good-names=i,j,k,ex,Run,_ | 174 good-names=i,j,k,ex,Run,_ |
201 | 175 |
202 # Bad variable names which should always be refused, separated by a comma | 176 # Bad variable names which should always be refused, separated by a comma |
203 bad-names=foo,bar,baz,toto,tutu,tata | 177 bad-names=foo,bar,baz,toto,tutu,tata |
204 | 178 |
205 # Regular expression which should only match functions or classes name which do | 179 # List of builtins function names that should not be used, separated by a comma |
206 # not require a docstring | 180 bad-functions=apply,input |
207 no-docstring-rgx=__.*__ | |
208 | 181 |
209 | 182 |
183 # checks for sign of poor/misdesign: | |
184 # * number of methods, attributes, local variables... | |
185 # * size, complexity of functions, methods | |
186 # | |
210 [DESIGN] | 187 [DESIGN] |
211 | 188 |
212 # Maximum number of arguments for function / method | 189 # Maximum number of arguments for function / method |
213 max-args=5 | 190 max-args=12 |
214 | |
215 # Argument names that match this expression will be ignored. Default to name | |
216 # with leading underscore | |
217 ignored-argument-names=_.* | |
218 | 191 |
219 # Maximum number of locals for function / method body | 192 # Maximum number of locals for function / method body |
220 max-locals=15 | 193 max-locals=30 |
221 | 194 |
222 # Maximum number of return / yield for function / method body | 195 # Maximum number of return / yield for function / method body |
223 max-returns=6 | 196 max-returns=12 |
224 | 197 |
225 # Maximum number of branch for function / method body | 198 # Maximum number of branch for function / method body |
226 max-branchs=12 | 199 max-branchs=30 |
227 | 200 |
228 # Maximum number of statements in function / method body | 201 # Maximum number of statements in function / method body |
229 max-statements=50 | 202 max-statements=60 |
230 | 203 |
231 # Maximum number of parents for a class (see R0901). | 204 # Maximum number of parents for a class (see R0901). |
232 max-parents=7 | 205 max-parents=7 |
233 | 206 |
234 # Maximum number of attributes for a class (see R0902). | 207 # Maximum number of attributes for a class (see R0902). |
235 max-attributes=7 | 208 max-attributes=20 |
236 | 209 |
237 # Minimum number of public methods for a class (see R0903). | 210 # Minimum number of public methods for a class (see R0903). |
238 min-public-methods=2 | 211 min-public-methods=0 |
239 | 212 |
240 # Maximum number of public methods for a class (see R0904). | 213 # Maximum number of public methods for a class (see R0904). |
241 max-public-methods=20 | 214 max-public-methods=20 |
242 | 215 |
243 | 216 |
244 [CLASSES] | 217 # checks for |
245 | 218 # * external modules dependencies |
246 # List of interface methods to ignore, separated by a comma. This is used for | 219 # * relative / wildcard imports |
247 # instance to not check methods defines in Zope's Interface base class. | 220 # * cyclic imports |
248 ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions ,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,ge tTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,a daptWith,is_implemented_by | 221 # * uses of deprecated modules |
249 | 222 # |
250 # List of method names used to declare (i.e. assign) instance attributes. | |
251 defining-attr-methods=__init__,__new__,setUp | |
252 | |
253 # List of valid names for the first argument in a class method. | |
254 valid-classmethod-first-arg=cls | |
255 | |
256 | |
257 [IMPORTS] | 223 [IMPORTS] |
258 | 224 |
259 # Deprecated modules which should not be used, separated by a comma | 225 # Deprecated modules which should not be used, separated by a comma |
260 deprecated-modules=regsub,string,TERMIOS,Bastion,rexec | 226 deprecated-modules=regsub,string,TERMIOS,Bastion,rexec |
261 | 227 |
262 # Create a graph of every (i.e. internal and external) dependencies in the | 228 # Create a graph of every (i.e. internal and external) dependencies in the |
263 # given file (report RP0402 must not be disabled) | 229 # given file (report R0402 must not be disabled) |
264 import-graph= | 230 import-graph= |
265 | 231 |
266 # Create a graph of external dependencies in the given file (report RP0402 must | 232 # Create a graph of external dependencies in the given file (report R0402 must |
267 # not be disabled) | 233 # not be disabled) |
268 ext-import-graph= | 234 ext-import-graph= |
269 | 235 |
270 # Create a graph of internal dependencies in the given file (report RP0402 must | 236 # Create a graph of internal dependencies in the given file (report R0402 must |
271 # not be disabled) | 237 # not be disabled) |
272 int-import-graph= | 238 int-import-graph= |
273 | 239 |
274 | 240 |
275 [EXCEPTIONS] | 241 # checks for : |
242 # * methods without self as first argument | |
243 # * overridden methods signature | |
244 # * access only to existant members via self | |
245 # * attributes not defined in the __init__ method | |
246 # * supported interfaces implementation | |
247 # * unreachable code | |
248 # | |
249 [CLASSES] | |
276 | 250 |
277 # Exceptions that will emit a warning when being caught. Defaults to | 251 # List of interface methods to ignore, separated by a comma. This is used for |
278 # "Exception" | 252 # instance to not check methods defines in Zope's Interface base class. |
279 overgeneral-exceptions=Exception | 253 # ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptio ns,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue, getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf ,adaptWith,is_implemented_by |
254 | |
255 # List of method names used to declare (i.e. assign) instance attributes. | |
256 defining-attr-methods=__init__,__new__,setUp | |
257 | |
258 | |
259 # checks for similarities and duplicated code. This computation may be | |
260 # memory / CPU intensive, so you should disable it if you experiments some | |
261 # problems. | |
262 # | |
263 [SIMILARITIES] | |
264 | |
265 # Minimum lines number of a similarity. | |
266 min-similarity-lines=5 | |
267 | |
268 # Ignore comments when computing similarities. | |
269 ignore-comments=yes | |
270 | |
271 # Ignore docstrings when computing similarities. | |
272 ignore-docstrings=yes | |
273 | |
274 | |
275 # checks for: | |
276 # * warning notes in the code like FIXME, XXX | |
277 # * PEP 263: source code with non ascii character but no encoding declaration | |
278 # | |
279 [MISCELLANEOUS] | |
280 | |
281 # List of note tags to take in consideration, separated by a comma. | |
282 notes=FIXME,XXX,TODO,BUG: | |
283 | |
284 | |
285 # checks for : | |
286 # * unauthorized constructions | |
287 # * strict indentation | |
288 # * line length | |
289 # * use of <> instead of != | |
290 # | |
291 [FORMAT] | |
292 | |
293 # Maximum number of characters on a single line. | |
294 max-line-length=80 | |
295 | |
296 # Maximum number of lines in a module | |
297 max-module-lines=1000 | |
298 | |
299 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 | |
300 # tab). | |
301 indent-string=' ' | |
302 | |
303 | |
304 [MESSAGES CONTROL] | |
305 disable-msg=C0301,C0111,C0103,R0201,W0702,C0324 | |
OLD | NEW |