|
1 # lint Python modules using external checkers. |
|
2 # |
|
3 # This is the main checker controling 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 # |
|
9 # This checker also defines the following reports: |
|
10 # * R0001: Total errors / warnings |
|
11 # * R0002: % errors / warnings by module |
|
12 # * R0003: Messages |
|
13 # * R0004: Global evaluation |
|
14 # |
|
15 [MASTER] |
|
16 # Add <file or directory> to the black list. It should be a base name, not a |
|
17 # path. You may set this option multiple times. |
|
18 ignore=CVS, |
|
19 .svn, |
|
20 .hg, |
|
21 .ropeproject, |
|
22 .eric4project, |
|
23 .eric5project, |
|
24 .eric6project, |
|
25 ThirdParty, |
|
26 Examples, |
|
27 Ruby, |
|
28 # ignore autogenerated files for Qt designer forms |
|
29 # Checks |
|
30 Ui_PyLintConfigDialog.py, |
|
31 Ui_PyLintExecDialog.py, |
|
32 Ui_SyntaxCheckerDialog.py, |
|
33 Ui_TabnannyDialog.py, |
|
34 Tabnanny.py, |
|
35 # DataViews |
|
36 Ui_CodeMetricsDialog.py, |
|
37 Ui_PyCoverageDialog.py, |
|
38 Ui_PyProfileDialog.py, |
|
39 # Debugger |
|
40 Ui_EditBreakpointDialog.py, |
|
41 Ui_EditWatchpointDialog.py, |
|
42 Ui_ExceptionsFilterDialog.py, |
|
43 Ui_StartCoverageDialog.py, |
|
44 Ui_StartDebugDialog.py, |
|
45 Ui_StartProfileDialog.py, |
|
46 Ui_StartRunDialog.py, |
|
47 Ui_VariableDetailDialog.py, |
|
48 Ui_VariablesFilterDialog.py, |
|
49 # DocumentationTools |
|
50 Ui_DocGeneratorExecDialog.py, |
|
51 Ui_EricapiConfigDialog.py, |
|
52 Ui_EricdocConfigDialog.py, |
|
53 # Graphics |
|
54 Ui_UMLSceneSizeDialog.py, |
|
55 Ui_ZoomDialog, |
|
56 # Helpviewer |
|
57 Ui_BookmarkDialog.py, |
|
58 Ui_SearchDialog.py, |
|
59 # Packagers |
|
60 Ui_CxfreezeConfigDialog.py, |
|
61 Ui_PackagersExecDialog.py, |
|
62 # Preferences |
|
63 Ui_ConfigurationDialog.py, |
|
64 Ui_ShortcutDialog.py, |
|
65 Ui_ShortcutsDialog.py, |
|
66 Ui_ToolConfigurationDialog.py, |
|
67 Ui_ToolGroupConfigurationDialog.py, |
|
68 Ui_ViewProfileDialog.py, |
|
69 # Preferences - ConfigurationPages |
|
70 Ui_ApplicationPage.py, |
|
71 Ui_CorbaPage.py, |
|
72 Ui_DebuggerGeneral1Page.py, |
|
73 Ui_DebuggerGeneral2Page.py, |
|
74 Ui_DebuggerPythonPage.py, |
|
75 Ui_DebuggerRubyPage.py, |
|
76 Ui_EditorAPIsPage.py, |
|
77 Ui_EditorAutocompletionPage.py, |
|
78 Ui_EditorCalltipsPage.py, |
|
79 Ui_EditorColoursPage.py, |
|
80 Ui_EditorGeneralPage.py, |
|
81 Ui_EditorHighlightersPage.py, |
|
82 Ui_EditorHighlightingStylesPage.py, |
|
83 Ui_EditorProperties1Page.py, |
|
84 Ui_EditorProperties2Page.py, |
|
85 Ui_EditorStylesPage.py, |
|
86 Ui_EmailPage.py, |
|
87 Ui_GraphicsPage.py, |
|
88 Ui_HelpDocumentationPage.py, |
|
89 Ui_HelpViewersPage.py, |
|
90 Ui_IconsPage.py, |
|
91 Ui_IconsPreviewDialog.py, |
|
92 Ui_InterfacePage.py, |
|
93 Ui_PrinterPage.py, |
|
94 Ui_ProgramsPage.py, |
|
95 Ui_ProjectPage.py, |
|
96 Ui_ProjectBrowserPage.py, |
|
97 Ui_PythonPage.py, |
|
98 Ui_QtPage.py, |
|
99 Ui_RefactoringPage.py, |
|
100 Ui_ShellPage.py, |
|
101 Ui_TasksPage.py, |
|
102 Ui_TemplatesPage.py, |
|
103 Ui_VcsPage.py, |
|
104 Ui_ViewmanagerPage.py, |
|
105 # Project |
|
106 Ui_AddDirectoryDialog.py, |
|
107 Ui_AddFileDialog.py, |
|
108 Ui_AddFoundFilesDialog.py, |
|
109 Ui_AddLanguageDialog.py, |
|
110 Ui_DebuggerPropertiesDialog.py, |
|
111 Ui_FiletypeAssociationsDialog.py, |
|
112 Ui_PropertiesDialog.py, |
|
113 Ui_TranslationPropertiesDialog.py, |
|
114 Ui_UserPropertiesDialog.py, |
|
115 # PyUnit |
|
116 Ui_UnittestDialog.py, |
|
117 Ui_UnittestStacktraceDialog.py, |
|
118 # QScintilla |
|
119 Ui_GotoDialog.py, |
|
120 Ui_ReplaceDialog.py, |
|
121 Ui_SearchDialog.py, |
|
122 Ui_ZoomDialog.py, |
|
123 # Refactoring |
|
124 Ui_MatchesDialog.py, |
|
125 # Scripting |
|
126 Ui_LoadScriptDialog.py, |
|
127 # Tasks |
|
128 Ui_TaskFilterConfigDialog.py, |
|
129 Ui_TaskPropertiesDialog.py, |
|
130 # Templates |
|
131 Ui_TemplatePropertiesDialog.py, |
|
132 Ui_TemplateSingleVariableDialog.py, |
|
133 # UI |
|
134 Ui_AboutDialog.py, |
|
135 Ui_CompareDialog.py, |
|
136 Ui_DeleteFilesConfirmationDialog.py, |
|
137 Ui_DiffDialog.py, |
|
138 Ui_EmailDialog.py, |
|
139 Ui_FindFileDialog.py, |
|
140 Ui_FindFileNameDialog.py, |
|
141 # VCS |
|
142 Ui_CommandOptionsDialog.py, |
|
143 Ui_RepositoryInfoDialog.py, |
|
144 # VCS - vcsCVS |
|
145 Ui_CvsCommandDialog.py, |
|
146 Ui_CvsCommitDialog.py, |
|
147 Ui_CvsDialog.py, |
|
148 Ui_CvsHistoryDialog.py, |
|
149 Ui_CvsLogDialog.py, |
|
150 Ui_CvsLoginDialog.py, |
|
151 Ui_CvsLogoutDialog.py, |
|
152 Ui_CvsMergeDialog.py, |
|
153 Ui_CvsNewProjectOptionsDialog.py, |
|
154 Ui_CvsOptionsDialog.py, |
|
155 Ui_CvsSwitchDialog.py, |
|
156 Ui_CvsTagDialog.py, |
|
157 # VCS - vcsPySvn, vcsSubversion |
|
158 Ui_SvnBlameDialog.py, |
|
159 Ui_SvnCommandDialog.py, |
|
160 Ui_SvnCommitDialog.py, |
|
161 Ui_SvnCopyDialog.py, |
|
162 Ui_SvnDialog.py, |
|
163 Ui_SvnDiffDialog.py, |
|
164 Ui_SvnLogDialog.py, |
|
165 Ui_SvnLoginDialog.py, |
|
166 Ui_SvnMergeDialog.py, |
|
167 Ui_SvnNewProjectOptionsDialog.py, |
|
168 Ui_SvnOptionsDialog.py, |
|
169 Ui_SvnPropDelDialog.py, |
|
170 Ui_SvnPropListDialog.py, |
|
171 Ui_SvnPropSetDialog.py, |
|
172 Ui_SvnRelocateDialog.py, |
|
173 Ui_SvnRevisionSelectionDialog.py, |
|
174 Ui_SvnStatusDialog.py, |
|
175 Ui_SvnSwitchDialog.py, |
|
176 Ui_SvnTagBranchListDialog.py, |
|
177 Ui_SvnTagDialog.py, |
|
178 Ui_SvnUrlSelectionDialog.py, |
|
179 # ViewManager |
|
180 Ui_BookmarkedFilesDialog.py, |
|
181 # Wizards |
|
182 Ui_ColorDialogWizardDialog.py, |
|
183 Ui_FileDialogWizardDialog.py, |
|
184 Ui_FontDialogWizardDialog.py, |
|
185 Ui_InputDialogWizardDialog.py, |
|
186 Ui_MessageBoxWizardDialog.py, |
|
187 Ui_PyRegExpWizardCharactersDialog.py, |
|
188 Ui_PyRegExpWizardDialog.py, |
|
189 Ui_PyRegExpWizardRepeatDialog.py, |
|
190 Ui_QRegExpWizardCharactersDialog.py, |
|
191 Ui_QRegExpWizardDialog.py, |
|
192 Ui_QRegExpWizardRepeatDialog.py, |
|
193 # XML |
|
194 Ui_XMLMessageDialog.py |
|
195 |
|
196 # Pickle collected data for later comparisons. |
|
197 persistent=yes |
|
198 |
|
199 # Set the cache size for astng objects. |
|
200 cache-size=500 |
|
201 |
|
202 |
|
203 |
|
204 [REPORTS] |
|
205 # Tells wether to display a full report or only the messages |
|
206 reports=yes |
|
207 |
|
208 # Use HTML as output format instead of text |
|
209 html=no |
|
210 |
|
211 # Use a parseable text output format, so your favorite text editor will be able |
|
212 # to jump to the line corresponding to a message. |
|
213 parseable=no |
|
214 |
|
215 # Colorizes text output using ansi escape codes |
|
216 color=no |
|
217 |
|
218 # Put messages in a separate file for each module / package specified on the |
|
219 # command line instead of printing them on stdout. Reports (if any) will be |
|
220 # written in a file name "pylint_global.[txt|html]". |
|
221 files-output=no |
|
222 |
|
223 # Python expression which should return a note less than 10 (10 is the highest |
|
224 # note).You have access to the variables errors warning, statement which |
|
225 # respectivly contain the number of errors / warnings messages and the total |
|
226 # number of statements analyzed. This is used by the global evaluation report |
|
227 # (R0004). |
|
228 evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) |
|
229 |
|
230 # Add a comment according to your evaluation note. This is used by the global |
|
231 # evaluation report (R0004). |
|
232 comment=no |
|
233 |
|
234 # Include message's id in output |
|
235 include-ids=no |
|
236 |
|
237 |
|
238 |
|
239 # checks for |
|
240 # * unused variables / imports |
|
241 # * undefined variables |
|
242 # * redefinition of variable from builtins or from an outer scope |
|
243 # * use of variable before assigment |
|
244 # |
|
245 [VARIABLES] |
|
246 # Enable / disable this checker |
|
247 enable-variables=yes |
|
248 |
|
249 # Tells wether we should check for unused import in __init__ files. |
|
250 init-import=no |
|
251 |
|
252 # List of variable names used for dummy variables (i.e. not used). |
|
253 dummy-variables=_,dummy |
|
254 |
|
255 # List of additional names supposed to be defined in builtins. Remember that you |
|
256 # should avoid to define new builtins when possible. |
|
257 additional-builtins= |
|
258 |
|
259 |
|
260 |
|
261 # checks for : |
|
262 # * doc strings |
|
263 # * modules / classes / functions / methods / arguments / variables name |
|
264 # * number of arguments, local variables, branchs, returns and statements in |
|
265 # functions, methods |
|
266 # * required module attributes |
|
267 # * dangerous default values as arguments |
|
268 # * redefinition of function / method / class |
|
269 # * uses of the global statement |
|
270 # |
|
271 # This checker also defines the following reports: |
|
272 # * R0101: Statistics by type |
|
273 # |
|
274 [BASIC] |
|
275 # Enable / disable this checker |
|
276 enable-basic=yes |
|
277 |
|
278 # Required attributes for module, separated by a comma |
|
279 #required-attributes=__revision__ |
|
280 required-attributes= |
|
281 |
|
282 # Regular expression which should only match functions or classes name which do |
|
283 # not require a docstring |
|
284 no-docstring-rgx=__.*__ |
|
285 |
|
286 # Minimal length for module / class / function / method / argument / variable |
|
287 # names |
|
288 min-name-length=2 |
|
289 |
|
290 # Regular expression which should only match correct module names |
|
291 module-rgx=(([a-z_][a-z0-9_\-]*)|([A-Z][a-zA-Z0-9_\-]+))$ |
|
292 |
|
293 # Regular expression which should only match correct module level names |
|
294 const-rgx=(([a-z_][a-zA-Z0-9_]*)|(__.*__))$ |
|
295 |
|
296 # Regular expression which should only match correct class names |
|
297 class-rgx=(([A-Z_][a-zA-Z0-9]+)|(__qt[A-Z][a-zA-Z0-9]+)|(__kde[A-Z][a-zA-Z0-9]+))$ |
|
298 |
|
299 # Regular expression which should only match correct function names |
|
300 function-rgx=[a-z_][a-zA-Z0-9_]*$ |
|
301 |
|
302 # Regular expression which should only match correct method names |
|
303 method-rgx=[a-z_][a-zA-Z0-9_]*$ |
|
304 |
|
305 # Regular expression which should only match correct instance attribute names |
|
306 attr-rgx=[a-z_][a-zA-Z0-9_]*$ |
|
307 |
|
308 # Regular expression which should only match correct argument names |
|
309 argument-rgx=[a-z_][a-zA-Z0-9_]*$ |
|
310 |
|
311 # Regular expression which should only match correct variable names |
|
312 variable-rgx=[a-z_][a-zA-Z0-9_]*$ |
|
313 |
|
314 # Regular expression which should only match correct list comprehension / |
|
315 # generator expression variable names |
|
316 inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ |
|
317 |
|
318 # Good variable names which should always be accepted, separated by a comma |
|
319 good-names=i,j,k,_,s,f |
|
320 |
|
321 # Bad variable names which should always be refused, separated by a comma |
|
322 bad-names=foo,bar,baz,toto,tutu,tata |
|
323 |
|
324 # List of builtins function names that should not be used, separated by a comma |
|
325 bad-functions=map,filter,apply,input |
|
326 |
|
327 |
|
328 |
|
329 # checks for sign of poor/misdesign: |
|
330 # * number of methods, attributes, local variables... |
|
331 # * size, complexity of functions, methods |
|
332 # |
|
333 [DESIGN] |
|
334 # Enable / disable this checker |
|
335 enable-design=yes |
|
336 |
|
337 # Maximum number of arguments for function / method |
|
338 max-args=5 |
|
339 |
|
340 # Maximum number of locals for function / method body |
|
341 max-locals=15 |
|
342 |
|
343 # Maximum number of return / yield for function / method body |
|
344 max-returns=6 |
|
345 |
|
346 # Maximum number of branch for function / method body |
|
347 max-branchs=12 |
|
348 |
|
349 # Maximum number of statements in function / method body |
|
350 max-statements=100 |
|
351 |
|
352 # Maximum number of parents for a class (see R0901). |
|
353 max-parents=7 |
|
354 |
|
355 # Maximum number of attributes for a class (see R0902). |
|
356 max-attributes=20 |
|
357 |
|
358 # Minimum number of public methods for a class (see R0903). |
|
359 min-public-methods=2 |
|
360 |
|
361 # Maximum number of public methods for a class (see R0904). |
|
362 max-public-methods=20 |
|
363 |
|
364 |
|
365 |
|
366 # checks for |
|
367 # * external modules dependencies |
|
368 # * relative / wildcard imports |
|
369 # * cyclic imports |
|
370 # * uses of deprecated modules |
|
371 # |
|
372 # This checker also defines the following reports: |
|
373 # * R0401: External dependencies |
|
374 # * R0402: Modules dependencies graph |
|
375 # |
|
376 [IMPORTS] |
|
377 # Enable / disable this checker |
|
378 enable-imports=yes |
|
379 |
|
380 # Deprecated modules which should not be used, separated by a comma |
|
381 deprecated-modules=regsub,string,TERMIOS,Bastion,rexec |
|
382 |
|
383 # Create a graph of every (i.e. internal and external) dependencies in the given |
|
384 # file (report R0402 must not be disabled) |
|
385 import-graph= |
|
386 |
|
387 # Create a graph of external dependencies in the given file (report R0402 must |
|
388 # not be disabled) |
|
389 ext-import-graph= |
|
390 |
|
391 # Create a graph of internal dependencies in the given file (report R0402 must |
|
392 # not be disabled) |
|
393 int-import-graph= |
|
394 |
|
395 |
|
396 |
|
397 # checks for : |
|
398 # * methods without self as first argument |
|
399 # * overriden methods signature |
|
400 # * access only to existant members via self |
|
401 # * attributes not defined in the __init__ method |
|
402 # * supported interfaces implementation |
|
403 # * unreachable code |
|
404 # |
|
405 [CLASSES] |
|
406 # Enable / disable this checker |
|
407 enable-classes=yes |
|
408 |
|
409 # List of interface methods to ignore, separated by a comma. This is used for |
|
410 # instance to not check methods defines in Zope's Interface base class. |
|
411 ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by |
|
412 |
|
413 # Tells wether missing members accessed in mixin class should be ignored. A |
|
414 # mixin class is detected if its name ends with "mixin" (case insensitive). |
|
415 ignore-mixin-members=yes |
|
416 |
|
417 |
|
418 |
|
419 # checks for |
|
420 # * excepts without exception filter |
|
421 # * string exceptions |
|
422 # |
|
423 [EXCEPTIONS] |
|
424 # Enable / disable this checker |
|
425 enable-exceptions=yes |
|
426 |
|
427 |
|
428 |
|
429 # does not check anything but gives some raw metrics : |
|
430 # * total number of lines |
|
431 # * total number of code lines |
|
432 # * total number of docstring lines |
|
433 # * total number of comments lines |
|
434 # * total number of empty lines |
|
435 # |
|
436 # This checker also defines the following reports: |
|
437 # * R0701: Raw metrics |
|
438 # |
|
439 [METRICS] |
|
440 # Enable / disable this checker |
|
441 enable-metrics=yes |
|
442 |
|
443 |
|
444 |
|
445 # checks for similarities and duplicated code. This computation may be |
|
446 # memory / CPU intensive, so you should disable it if you experiments some |
|
447 # problems. |
|
448 # |
|
449 # This checker also defines the following reports: |
|
450 # * R0801: Duplication |
|
451 # |
|
452 [SIMILARITIES] |
|
453 # Enable / disable this checker |
|
454 enable-similarities=yes |
|
455 |
|
456 # Minimum lines number of a similarity. |
|
457 min-similarity-lines=4 |
|
458 |
|
459 # Ignore comments when computing similarities. |
|
460 ignore-comments=yes |
|
461 |
|
462 |
|
463 |
|
464 # checks for: |
|
465 # * warning notes in the code like FIXME, XXX |
|
466 # * PEP 263: source code with non ascii character but no encoding declaration |
|
467 # |
|
468 [MISCELLANEOUS] |
|
469 # Enable / disable this checker |
|
470 enable-miscellaneous=yes |
|
471 |
|
472 # List of note tags to take in consideration, separated by a comma. Default to |
|
473 # FIXME, XXX, TODO |
|
474 notes=FIXME,XXX,TODO |
|
475 |
|
476 |
|
477 |
|
478 # checks for : |
|
479 # * unauthorized constructions |
|
480 # * strict indentation |
|
481 # * line length |
|
482 # * use of <> instead of != |
|
483 # |
|
484 [FORMAT] |
|
485 # Enable / disable this checker |
|
486 enable-format=yes |
|
487 |
|
488 # Maximum number of characters on a single line. |
|
489 max-line-length=90 |
|
490 |
|
491 # Maximum number of lines in a module |
|
492 max-module-lines=1000 |
|
493 |
|
494 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab). |
|
495 indent-string=' ' |
|
496 |
|
497 |
|
498 |