eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html

branch
eric7
changeset 8372
e0227a7c850e
child 8596
d64760b2da50
equal deleted inserted replaced
8371:d6062691d424 8372:e0227a7c850e
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body>
22 <a NAME="top" ID="top"></a>
23 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog</h1>
24
25 <p>
26 Module implementing a dialog to show the results of the code style check.
27 </p>
28 <h3>Global Attributes</h3>
29
30 <table>
31 <tr><td>None</td></tr>
32 </table>
33 <h3>Classes</h3>
34
35 <table>
36
37 <tr>
38 <td><a href="#CodeStyleCheckerDialog">CodeStyleCheckerDialog</a></td>
39 <td>Class implementing a dialog to show the results of the code style check.</td>
40 </tr>
41 </table>
42 <h3>Functions</h3>
43
44 <table>
45 <tr><td>None</td></tr>
46 </table>
47 <hr />
48 <hr />
49 <a NAME="CodeStyleCheckerDialog" ID="CodeStyleCheckerDialog"></a>
50 <h2>CodeStyleCheckerDialog</h2>
51
52 <p>
53 Class implementing a dialog to show the results of the code style check.
54 </p>
55 <h3>Derived from</h3>
56 QDialog, Ui_CodeStyleCheckerDialog
57 <h3>Class Attributes</h3>
58
59 <table>
60 <tr><td>argsRole</td></tr><tr><td>availableFutures</td></tr><tr><td>checkCategories</td></tr><tr><td>codeRole</td></tr><tr><td>cryptoBitSelectionsDsaRsa</td></tr><tr><td>cryptoBitSelectionsEc</td></tr><tr><td>filenameRole</td></tr><tr><td>fixableRole</td></tr><tr><td>hasResults</td></tr><tr><td>ignoredRole</td></tr><tr><td>lineRole</td></tr><tr><td>messageRole</td></tr><tr><td>noFiles</td></tr><tr><td>noResults</td></tr><tr><td>positionRole</td></tr>
61 </table>
62 <h3>Class Methods</h3>
63
64 <table>
65 <tr><td>None</td></tr>
66 </table>
67 <h3>Methods</h3>
68
69 <table>
70
71 <tr>
72 <td><a href="#CodeStyleCheckerDialog.__init__">CodeStyleCheckerDialog</a></td>
73 <td>Constructor</td>
74 </tr>
75 <tr>
76 <td><a href="#CodeStyleCheckerDialog.__assembleExcludeMessages">__assembleExcludeMessages</a></td>
77 <td>Private method to assemble the list of excluded checks.</td>
78 </tr>
79 <tr>
80 <td><a href="#CodeStyleCheckerDialog.__batchFinished">__batchFinished</a></td>
81 <td>Private slot handling the completion of a batch job.</td>
82 </tr>
83 <tr>
84 <td><a href="#CodeStyleCheckerDialog.__cleanupData">__cleanupData</a></td>
85 <td>Private method to clean the loaded/entered data of redundant entries.</td>
86 </tr>
87 <tr>
88 <td><a href="#CodeStyleCheckerDialog.__clearErrors">__clearErrors</a></td>
89 <td>Private method to clear all warning markers of open editors to be checked.</td>
90 </tr>
91 <tr>
92 <td><a href="#CodeStyleCheckerDialog.__createErrorItem">__createErrorItem</a></td>
93 <td>Private slot to create a new error item in the result list.</td>
94 </tr>
95 <tr>
96 <td><a href="#CodeStyleCheckerDialog.__createFileErrorItem">__createFileErrorItem</a></td>
97 <td>Private method to create an error entry for a given file.</td>
98 </tr>
99 <tr>
100 <td><a href="#CodeStyleCheckerDialog.__createResultItem">__createResultItem</a></td>
101 <td>Private method to create an entry in the result list.</td>
102 </tr>
103 <tr>
104 <td><a href="#CodeStyleCheckerDialog.__defaultStatistics">__defaultStatistics</a></td>
105 <td>Private method to return the default statistics entry.</td>
106 </tr>
107 <tr>
108 <td><a href="#CodeStyleCheckerDialog.__finish">__finish</a></td>
109 <td>Private slot called when the code style check finished or the user pressed the cancel button.</td>
110 </tr>
111 <tr>
112 <td><a href="#CodeStyleCheckerDialog.__getBuiltinsIgnoreList">__getBuiltinsIgnoreList</a></td>
113 <td>Private method to get a dictionary containing the builtins assignments to be ignored.</td>
114 </tr>
115 <tr>
116 <td><a href="#CodeStyleCheckerDialog.__getCategories">__getCategories</a></td>
117 <td>Private method to get the enabled or disabled checker categories.</td>
118 </tr>
119 <tr>
120 <td><a href="#CodeStyleCheckerDialog.__getCommentedCodeCheckerWhiteList">__getCommentedCodeCheckerWhiteList</a></td>
121 <td>Private method to get the list of commented code whitelist patterns.</td>
122 </tr>
123 <tr>
124 <td><a href="#CodeStyleCheckerDialog.__getEol">__getEol</a></td>
125 <td>Private method to get the applicable eol string.</td>
126 </tr>
127 <tr>
128 <td><a href="#CodeStyleCheckerDialog.__getSelectedFixableItems">__getSelectedFixableItems</a></td>
129 <td>Private method to extract all selected items for fixable issues.</td>
130 </tr>
131 <tr>
132 <td><a href="#CodeStyleCheckerDialog.__getSelectedFutureImports">__getSelectedFutureImports</a></td>
133 <td>Private method to get the expected future imports.</td>
134 </tr>
135 <tr>
136 <td><a href="#CodeStyleCheckerDialog.__initBuiltinsIgnoreList">__initBuiltinsIgnoreList</a></td>
137 <td>Private method to populate the list of shadowed builtins to be ignored.</td>
138 </tr>
139 <tr>
140 <td><a href="#CodeStyleCheckerDialog.__initCategoriesList">__initCategoriesList</a></td>
141 <td>Private method to set the enabled status of the checker categories.</td>
142 </tr>
143 <tr>
144 <td><a href="#CodeStyleCheckerDialog.__initCommentedCodeCheckerWhiteList">__initCommentedCodeCheckerWhiteList</a></td>
145 <td>Private method to populate the list of commented code whitelist patterns.</td>
146 </tr>
147 <tr>
148 <td><a href="#CodeStyleCheckerDialog.__initFuturesList">__initFuturesList</a></td>
149 <td>Private method to set the selected status of the future imports.</td>
150 </tr>
151 <tr>
152 <td><a href="#CodeStyleCheckerDialog.__itemFixable">__itemFixable</a></td>
153 <td>Private method to check, if an item has a fixable issue.</td>
154 </tr>
155 <tr>
156 <td><a href="#CodeStyleCheckerDialog.__modifyFixedResultItem">__modifyFixedResultItem</a></td>
157 <td>Private method to modify a result list entry to show its positive fixed state.</td>
158 </tr>
159 <tr>
160 <td><a href="#CodeStyleCheckerDialog.__modifyOptions">__modifyOptions</a></td>
161 <td>Private method to modify the options based on eflag: entries.</td>
162 </tr>
163 <tr>
164 <td><a href="#CodeStyleCheckerDialog.__prepareProgress">__prepareProgress</a></td>
165 <td>Private method to prepare the progress tab for the next run.</td>
166 </tr>
167 <tr>
168 <td><a href="#CodeStyleCheckerDialog.__processError">__processError</a></td>
169 <td>Private slot to process an error indication from the service.</td>
170 </tr>
171 <tr>
172 <td><a href="#CodeStyleCheckerDialog.__processResult">__processResult</a></td>
173 <td>Private slot called after perfoming a style check on one file.</td>
174 </tr>
175 <tr>
176 <td><a href="#CodeStyleCheckerDialog.__resetStatistics">__resetStatistics</a></td>
177 <td>Private slot to reset the statistics data.</td>
178 </tr>
179 <tr>
180 <td><a href="#CodeStyleCheckerDialog.__resort">__resort</a></td>
181 <td>Private method to resort the tree.</td>
182 </tr>
183 <tr>
184 <td><a href="#CodeStyleCheckerDialog.__selectCodes">__selectCodes</a></td>
185 <td>Private method to select message codes via a selection dialog.</td>
186 </tr>
187 <tr>
188 <td><a href="#CodeStyleCheckerDialog.__updateFixerStatistics">__updateFixerStatistics</a></td>
189 <td>Private method to update the collected fixer related statistics.</td>
190 </tr>
191 <tr>
192 <td><a href="#CodeStyleCheckerDialog.__updateProgress">__updateProgress</a></td>
193 <td>Private method to update the progress tab.</td>
194 </tr>
195 <tr>
196 <td><a href="#CodeStyleCheckerDialog.__updateStatistics">__updateStatistics</a></td>
197 <td>Private method to update the collected statistics.</td>
198 </tr>
199 <tr>
200 <td><a href="#CodeStyleCheckerDialog.check">check</a></td>
201 <td>Public method to start a style check for one file.</td>
202 </tr>
203 <tr>
204 <td><a href="#CodeStyleCheckerDialog.checkBatch">checkBatch</a></td>
205 <td>Public method to start a style check batch job.</td>
206 </tr>
207 <tr>
208 <td><a href="#CodeStyleCheckerDialog.on_addBuiltinButton_clicked">on_addBuiltinButton_clicked</a></td>
209 <td>Private slot to add a built-in assignment to be ignored.</td>
210 </tr>
211 <tr>
212 <td><a href="#CodeStyleCheckerDialog.on_addWhitelistButton_clicked">on_addWhitelistButton_clicked</a></td>
213 <td>Private slot to add a commented code whitelist pattern.</td>
214 </tr>
215 <tr>
216 <td><a href="#CodeStyleCheckerDialog.on_builtinsAssignmentList_itemSelectionChanged">on_builtinsAssignmentList_itemSelectionChanged</a></td>
217 <td>Private slot to react upon changes of the selected builtin assignments.</td>
218 </tr>
219 <tr>
220 <td><a href="#CodeStyleCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td>
221 <td>Private slot called by a button of the button box clicked.</td>
222 </tr>
223 <tr>
224 <td><a href="#CodeStyleCheckerDialog.on_cancelButton_clicked">on_cancelButton_clicked</a></td>
225 <td>Private slot to handle the "Cancel" button press.</td>
226 </tr>
227 <tr>
228 <td><a href="#CodeStyleCheckerDialog.on_deleteBuiltinButton_clicked">on_deleteBuiltinButton_clicked</a></td>
229 <td>Private slot to delete the selected items from the list.</td>
230 </tr>
231 <tr>
232 <td><a href="#CodeStyleCheckerDialog.on_deleteWhitelistButton_clicked">on_deleteWhitelistButton_clicked</a></td>
233 <td>Private slot to delete the selected items from the list.</td>
234 </tr>
235 <tr>
236 <td><a href="#CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked">on_excludeMessagesSelectButton_clicked</a></td>
237 <td>Private slot to select the message codes to be excluded via a selection dialog.</td>
238 </tr>
239 <tr>
240 <td><a href="#CodeStyleCheckerDialog.on_filterButton_clicked">on_filterButton_clicked</a></td>
241 <td>Private slot to filter the list of messages based on selected message code.</td>
242 </tr>
243 <tr>
244 <td><a href="#CodeStyleCheckerDialog.on_fixButton_clicked">on_fixButton_clicked</a></td>
245 <td>Private slot to fix selected issues.</td>
246 </tr>
247 <tr>
248 <td><a href="#CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked">on_fixIssuesSelectButton_clicked</a></td>
249 <td>Private slot to select the issue codes to be fixed via a selection dialog.</td>
250 </tr>
251 <tr>
252 <td><a href="#CodeStyleCheckerDialog.on_includeMessagesSelectButton_clicked">on_includeMessagesSelectButton_clicked</a></td>
253 <td>Private slot to select the message codes to be included via a selection dialog.</td>
254 </tr>
255 <tr>
256 <td><a href="#CodeStyleCheckerDialog.on_loadDefaultButton_clicked">on_loadDefaultButton_clicked</a></td>
257 <td>Private slot to load the default configuration values.</td>
258 </tr>
259 <tr>
260 <td><a href="#CodeStyleCheckerDialog.on_noFixIssuesSelectButton_clicked">on_noFixIssuesSelectButton_clicked</a></td>
261 <td>Private slot to select the issue codes not to be fixed via a selection dialog.</td>
262 </tr>
263 <tr>
264 <td><a href="#CodeStyleCheckerDialog.on_resetDefaultButton_clicked">on_resetDefaultButton_clicked</a></td>
265 <td>Private slot to reset the configuration values to their default values.</td>
266 </tr>
267 <tr>
268 <td><a href="#CodeStyleCheckerDialog.on_restartButton_clicked">on_restartButton_clicked</a></td>
269 <td>Private slot to restart a code style check run.</td>
270 </tr>
271 <tr>
272 <td><a href="#CodeStyleCheckerDialog.on_resultList_itemActivated">on_resultList_itemActivated</a></td>
273 <td>Private slot to handle the activation of an item.</td>
274 </tr>
275 <tr>
276 <td><a href="#CodeStyleCheckerDialog.on_resultList_itemSelectionChanged">on_resultList_itemSelectionChanged</a></td>
277 <td>Private slot to change the dialog state depending on the selection.</td>
278 </tr>
279 <tr>
280 <td><a href="#CodeStyleCheckerDialog.on_showButton_clicked">on_showButton_clicked</a></td>
281 <td>Private slot to handle the "Show" button press.</td>
282 </tr>
283 <tr>
284 <td><a href="#CodeStyleCheckerDialog.on_startButton_clicked">on_startButton_clicked</a></td>
285 <td>Private slot to start a code style check run.</td>
286 </tr>
287 <tr>
288 <td><a href="#CodeStyleCheckerDialog.on_statisticsButton_clicked">on_statisticsButton_clicked</a></td>
289 <td>Private slot to show the statistics dialog.</td>
290 </tr>
291 <tr>
292 <td><a href="#CodeStyleCheckerDialog.on_storeDefaultButton_clicked">on_storeDefaultButton_clicked</a></td>
293 <td>Private slot to store the current configuration values as default values.</td>
294 </tr>
295 <tr>
296 <td><a href="#CodeStyleCheckerDialog.on_whitelistWidget_itemSelectionChanged">on_whitelistWidget_itemSelectionChanged</a></td>
297 <td>Private slot to react upon changes of the selected whitelist patterns.</td>
298 </tr>
299 <tr>
300 <td><a href="#CodeStyleCheckerDialog.prepare">prepare</a></td>
301 <td>Public method to prepare the dialog with a list of filenames.</td>
302 </tr>
303 <tr>
304 <td><a href="#CodeStyleCheckerDialog.start">start</a></td>
305 <td>Public slot to start the code style check.</td>
306 </tr>
307 </table>
308 <h3>Static Methods</h3>
309
310 <table>
311 <tr><td>None</td></tr>
312 </table>
313
314 <a NAME="CodeStyleCheckerDialog.__init__" ID="CodeStyleCheckerDialog.__init__"></a>
315 <h4>CodeStyleCheckerDialog (Constructor)</h4>
316 <b>CodeStyleCheckerDialog</b>(<i>styleCheckService, project=None, parent=None</i>)
317
318 <p>
319 Constructor
320 </p>
321 <dl>
322
323 <dt><i>styleCheckService</i> (CodeStyleCheckService)</dt>
324 <dd>
325 reference to the service
326 </dd>
327 <dt><i>project</i> (Project)</dt>
328 <dd>
329 reference to the project if called on project or project
330 browser level
331 </dd>
332 <dt><i>parent</i> (QWidget)</dt>
333 <dd>
334 reference to the parent widget
335 </dd>
336 </dl>
337 <a NAME="CodeStyleCheckerDialog.__assembleExcludeMessages" ID="CodeStyleCheckerDialog.__assembleExcludeMessages"></a>
338 <h4>CodeStyleCheckerDialog.__assembleExcludeMessages</h4>
339 <b>__assembleExcludeMessages</b>(<i></i>)
340
341 <p>
342 Private method to assemble the list of excluded checks.
343 </p>
344 <dl>
345 <dt>Return:</dt>
346 <dd>
347 list of excluded checks as a comma separated string.
348 </dd>
349 </dl>
350 <dl>
351 <dt>Return Type:</dt>
352 <dd>
353 str
354 </dd>
355 </dl>
356 <a NAME="CodeStyleCheckerDialog.__batchFinished" ID="CodeStyleCheckerDialog.__batchFinished"></a>
357 <h4>CodeStyleCheckerDialog.__batchFinished</h4>
358 <b>__batchFinished</b>(<i></i>)
359
360 <p>
361 Private slot handling the completion of a batch job.
362 </p>
363 <a NAME="CodeStyleCheckerDialog.__cleanupData" ID="CodeStyleCheckerDialog.__cleanupData"></a>
364 <h4>CodeStyleCheckerDialog.__cleanupData</h4>
365 <b>__cleanupData</b>(<i></i>)
366
367 <p>
368 Private method to clean the loaded/entered data of redundant entries.
369 </p>
370 <a NAME="CodeStyleCheckerDialog.__clearErrors" ID="CodeStyleCheckerDialog.__clearErrors"></a>
371 <h4>CodeStyleCheckerDialog.__clearErrors</h4>
372 <b>__clearErrors</b>(<i>files</i>)
373
374 <p>
375 Private method to clear all warning markers of open editors to be
376 checked.
377 </p>
378 <dl>
379
380 <dt><i>files</i> (list of str)</dt>
381 <dd>
382 list of files to be checked
383 </dd>
384 </dl>
385 <a NAME="CodeStyleCheckerDialog.__createErrorItem" ID="CodeStyleCheckerDialog.__createErrorItem"></a>
386 <h4>CodeStyleCheckerDialog.__createErrorItem</h4>
387 <b>__createErrorItem</b>(<i>filename, message</i>)
388
389 <p>
390 Private slot to create a new error item in the result list.
391 </p>
392 <dl>
393
394 <dt><i>filename</i> (str)</dt>
395 <dd>
396 name of the file
397 </dd>
398 <dt><i>message</i> (str)</dt>
399 <dd>
400 error message
401 </dd>
402 </dl>
403 <a NAME="CodeStyleCheckerDialog.__createFileErrorItem" ID="CodeStyleCheckerDialog.__createFileErrorItem"></a>
404 <h4>CodeStyleCheckerDialog.__createFileErrorItem</h4>
405 <b>__createFileErrorItem</b>(<i>filename, message</i>)
406
407 <p>
408 Private method to create an error entry for a given file.
409 </p>
410 <dl>
411
412 <dt><i>filename</i> (str)</dt>
413 <dd>
414 file name of the file
415 </dd>
416 <dt><i>message</i> (str)</dt>
417 <dd>
418 error message text
419 </dd>
420 </dl>
421 <a NAME="CodeStyleCheckerDialog.__createResultItem" ID="CodeStyleCheckerDialog.__createResultItem"></a>
422 <h4>CodeStyleCheckerDialog.__createResultItem</h4>
423 <b>__createResultItem</b>(<i>filename, result</i>)
424
425 <p>
426 Private method to create an entry in the result list.
427 </p>
428 <dl>
429
430 <dt><i>filename</i> (str)</dt>
431 <dd>
432 file name of the file
433 </dd>
434 <dt><i>result</i> (dict)</dt>
435 <dd>
436 dictionary containing check result data
437 </dd>
438 </dl>
439 <dl>
440 <dt>Return:</dt>
441 <dd>
442 reference to the created item
443 </dd>
444 </dl>
445 <dl>
446 <dt>Return Type:</dt>
447 <dd>
448 QTreeWidgetItem
449 </dd>
450 </dl>
451 <a NAME="CodeStyleCheckerDialog.__defaultStatistics" ID="CodeStyleCheckerDialog.__defaultStatistics"></a>
452 <h4>CodeStyleCheckerDialog.__defaultStatistics</h4>
453 <b>__defaultStatistics</b>(<i></i>)
454
455 <p>
456 Private method to return the default statistics entry.
457 </p>
458 <dl>
459 <dt>Return:</dt>
460 <dd>
461 dictionary with default statistics entry
462 </dd>
463 </dl>
464 <dl>
465 <dt>Return Type:</dt>
466 <dd>
467 dict
468 </dd>
469 </dl>
470 <a NAME="CodeStyleCheckerDialog.__finish" ID="CodeStyleCheckerDialog.__finish"></a>
471 <h4>CodeStyleCheckerDialog.__finish</h4>
472 <b>__finish</b>(<i></i>)
473
474 <p>
475 Private slot called when the code style check finished or the user
476 pressed the cancel button.
477 </p>
478 <a NAME="CodeStyleCheckerDialog.__getBuiltinsIgnoreList" ID="CodeStyleCheckerDialog.__getBuiltinsIgnoreList"></a>
479 <h4>CodeStyleCheckerDialog.__getBuiltinsIgnoreList</h4>
480 <b>__getBuiltinsIgnoreList</b>(<i></i>)
481
482 <p>
483 Private method to get a dictionary containing the builtins assignments
484 to be ignored.
485 </p>
486 <dl>
487 <dt>Return:</dt>
488 <dd>
489 dictionary containing the builtins assignments to be ignored
490 </dd>
491 </dl>
492 <dl>
493 <dt>Return Type:</dt>
494 <dd>
495 dict of list of str
496 </dd>
497 </dl>
498 <a NAME="CodeStyleCheckerDialog.__getCategories" ID="CodeStyleCheckerDialog.__getCategories"></a>
499 <h4>CodeStyleCheckerDialog.__getCategories</h4>
500 <b>__getCategories</b>(<i>enabled, asList=False</i>)
501
502 <p>
503 Private method to get the enabled or disabled checker categories.
504 </p>
505 <dl>
506
507 <dt><i>enabled</i> (bool)</dt>
508 <dd>
509 flag indicating to return enabled categories
510 </dd>
511 <dt><i>asList</i> (bool)</dt>
512 <dd>
513 flag indicating to return the checker categories as a
514 Python list
515 </dd>
516 </dl>
517 <dl>
518 <dt>Return:</dt>
519 <dd>
520 checker categories as a list or comma separated string
521 </dd>
522 </dl>
523 <dl>
524 <dt>Return Type:</dt>
525 <dd>
526 str or list of str
527 </dd>
528 </dl>
529 <a NAME="CodeStyleCheckerDialog.__getCommentedCodeCheckerWhiteList" ID="CodeStyleCheckerDialog.__getCommentedCodeCheckerWhiteList"></a>
530 <h4>CodeStyleCheckerDialog.__getCommentedCodeCheckerWhiteList</h4>
531 <b>__getCommentedCodeCheckerWhiteList</b>(<i></i>)
532
533 <p>
534 Private method to get the list of commented code whitelist patterns.
535 </p>
536 <dl>
537 <dt>Return:</dt>
538 <dd>
539 list of commented code whitelist patterns
540 </dd>
541 </dl>
542 <dl>
543 <dt>Return Type:</dt>
544 <dd>
545 list of str
546 </dd>
547 </dl>
548 <a NAME="CodeStyleCheckerDialog.__getEol" ID="CodeStyleCheckerDialog.__getEol"></a>
549 <h4>CodeStyleCheckerDialog.__getEol</h4>
550 <b>__getEol</b>(<i>fn</i>)
551
552 <p>
553 Private method to get the applicable eol string.
554 </p>
555 <dl>
556
557 <dt><i>fn</i> (str)</dt>
558 <dd>
559 filename where to determine the line ending
560 </dd>
561 </dl>
562 <dl>
563 <dt>Return:</dt>
564 <dd>
565 eol string
566 </dd>
567 </dl>
568 <dl>
569 <dt>Return Type:</dt>
570 <dd>
571 str
572 </dd>
573 </dl>
574 <a NAME="CodeStyleCheckerDialog.__getSelectedFixableItems" ID="CodeStyleCheckerDialog.__getSelectedFixableItems"></a>
575 <h4>CodeStyleCheckerDialog.__getSelectedFixableItems</h4>
576 <b>__getSelectedFixableItems</b>(<i></i>)
577
578 <p>
579 Private method to extract all selected items for fixable issues.
580 </p>
581 <dl>
582 <dt>Return:</dt>
583 <dd>
584 selected items for fixable issues
585 </dd>
586 </dl>
587 <dl>
588 <dt>Return Type:</dt>
589 <dd>
590 list of QTreeWidgetItem
591 </dd>
592 </dl>
593 <a NAME="CodeStyleCheckerDialog.__getSelectedFutureImports" ID="CodeStyleCheckerDialog.__getSelectedFutureImports"></a>
594 <h4>CodeStyleCheckerDialog.__getSelectedFutureImports</h4>
595 <b>__getSelectedFutureImports</b>(<i></i>)
596
597 <p>
598 Private method to get the expected future imports.
599 </p>
600 <dl>
601 <dt>Return:</dt>
602 <dd>
603 expected future imports as a comma separated string
604 </dd>
605 </dl>
606 <dl>
607 <dt>Return Type:</dt>
608 <dd>
609 str
610 </dd>
611 </dl>
612 <a NAME="CodeStyleCheckerDialog.__initBuiltinsIgnoreList" ID="CodeStyleCheckerDialog.__initBuiltinsIgnoreList"></a>
613 <h4>CodeStyleCheckerDialog.__initBuiltinsIgnoreList</h4>
614 <b>__initBuiltinsIgnoreList</b>(<i>builtinsIgnoreDict</i>)
615
616 <p>
617 Private method to populate the list of shadowed builtins to be ignored.
618 </p>
619 <dl>
620
621 <dt><i>builtinsIgnoreDict</i> (dict of list of str)</dt>
622 <dd>
623 dictionary containing the builtins
624 assignments to be ignored
625 </dd>
626 </dl>
627 <a NAME="CodeStyleCheckerDialog.__initCategoriesList" ID="CodeStyleCheckerDialog.__initCategoriesList"></a>
628 <h4>CodeStyleCheckerDialog.__initCategoriesList</h4>
629 <b>__initCategoriesList</b>(<i>enabledCategories</i>)
630
631 <p>
632 Private method to set the enabled status of the checker categories.
633 </p>
634 <dl>
635
636 <dt><i>enabledCategories</i> (str)</dt>
637 <dd>
638 comma separated list of enabled checker
639 categories
640 </dd>
641 </dl>
642 <a NAME="CodeStyleCheckerDialog.__initCommentedCodeCheckerWhiteList" ID="CodeStyleCheckerDialog.__initCommentedCodeCheckerWhiteList"></a>
643 <h4>CodeStyleCheckerDialog.__initCommentedCodeCheckerWhiteList</h4>
644 <b>__initCommentedCodeCheckerWhiteList</b>(<i>whitelist</i>)
645
646 <p>
647 Private method to populate the list of commented code whitelist
648 patterns.
649 </p>
650 <dl>
651
652 <dt><i>whitelist</i> (list of str)</dt>
653 <dd>
654 list of commented code whitelist patterns
655 </dd>
656 </dl>
657 <a NAME="CodeStyleCheckerDialog.__initFuturesList" ID="CodeStyleCheckerDialog.__initFuturesList"></a>
658 <h4>CodeStyleCheckerDialog.__initFuturesList</h4>
659 <b>__initFuturesList</b>(<i>selectedFutures</i>)
660
661 <p>
662 Private method to set the selected status of the future imports.
663 </p>
664 <dl>
665
666 <dt><i>selectedFutures</i> (str)</dt>
667 <dd>
668 comma separated list of expected future imports
669 </dd>
670 </dl>
671 <a NAME="CodeStyleCheckerDialog.__itemFixable" ID="CodeStyleCheckerDialog.__itemFixable"></a>
672 <h4>CodeStyleCheckerDialog.__itemFixable</h4>
673 <b>__itemFixable</b>(<i>itm</i>)
674
675 <p>
676 Private method to check, if an item has a fixable issue.
677 </p>
678 <dl>
679
680 <dt><i>itm</i> (QTreeWidgetItem)</dt>
681 <dd>
682 item to be checked
683 </dd>
684 </dl>
685 <dl>
686 <dt>Return:</dt>
687 <dd>
688 flag indicating a fixable issue
689 </dd>
690 </dl>
691 <dl>
692 <dt>Return Type:</dt>
693 <dd>
694 bool
695 </dd>
696 </dl>
697 <a NAME="CodeStyleCheckerDialog.__modifyFixedResultItem" ID="CodeStyleCheckerDialog.__modifyFixedResultItem"></a>
698 <h4>CodeStyleCheckerDialog.__modifyFixedResultItem</h4>
699 <b>__modifyFixedResultItem</b>(<i>itm, result</i>)
700
701 <p>
702 Private method to modify a result list entry to show its
703 positive fixed state.
704 </p>
705 <dl>
706
707 <dt><i>itm</i> (QTreeWidgetItem)</dt>
708 <dd>
709 reference to the item to modify
710 </dd>
711 <dt><i>result</i> (dict)</dt>
712 <dd>
713 dictionary containing check result data
714 </dd>
715 </dl>
716 <a NAME="CodeStyleCheckerDialog.__modifyOptions" ID="CodeStyleCheckerDialog.__modifyOptions"></a>
717 <h4>CodeStyleCheckerDialog.__modifyOptions</h4>
718 <b>__modifyOptions</b>(<i>source</i>)
719
720 <p>
721 Private method to modify the options based on eflag: entries.
722 </p>
723 <p>
724 This method looks for comment lines like '# eflag: noqa = M601'
725 at the end of the source in order to extend the list of excluded
726 messages for one file only.
727 </p>
728 <dl>
729
730 <dt><i>source</i> (list of str or str)</dt>
731 <dd>
732 source text
733 </dd>
734 </dl>
735 <dl>
736 <dt>Return:</dt>
737 <dd>
738 list of checker options
739 </dd>
740 </dl>
741 <dl>
742 <dt>Return Type:</dt>
743 <dd>
744 list
745 </dd>
746 </dl>
747 <a NAME="CodeStyleCheckerDialog.__prepareProgress" ID="CodeStyleCheckerDialog.__prepareProgress"></a>
748 <h4>CodeStyleCheckerDialog.__prepareProgress</h4>
749 <b>__prepareProgress</b>(<i></i>)
750
751 <p>
752 Private method to prepare the progress tab for the next run.
753 </p>
754 <a NAME="CodeStyleCheckerDialog.__processError" ID="CodeStyleCheckerDialog.__processError"></a>
755 <h4>CodeStyleCheckerDialog.__processError</h4>
756 <b>__processError</b>(<i>fn, msg</i>)
757
758 <p>
759 Private slot to process an error indication from the service.
760 </p>
761 <dl>
762
763 <dt><i>fn</i> (str)</dt>
764 <dd>
765 filename of the file
766 </dd>
767 <dt><i>msg</i> (str)</dt>
768 <dd>
769 error message
770 </dd>
771 </dl>
772 <a NAME="CodeStyleCheckerDialog.__processResult" ID="CodeStyleCheckerDialog.__processResult"></a>
773 <h4>CodeStyleCheckerDialog.__processResult</h4>
774 <b>__processResult</b>(<i>fn, codeStyleCheckerStats, fixes, results</i>)
775
776 <p>
777 Private slot called after perfoming a style check on one file.
778 </p>
779 <dl>
780
781 <dt><i>fn</i> (str)</dt>
782 <dd>
783 filename of the just checked file
784 </dd>
785 <dt><i>codeStyleCheckerStats</i> (dict)</dt>
786 <dd>
787 stats of style and name check
788 </dd>
789 <dt><i>fixes</i> (int)</dt>
790 <dd>
791 number of applied fixes
792 </dd>
793 <dt><i>results</i> (dict)</dt>
794 <dd>
795 dictionary containing check result data
796 </dd>
797 </dl>
798 <a NAME="CodeStyleCheckerDialog.__resetStatistics" ID="CodeStyleCheckerDialog.__resetStatistics"></a>
799 <h4>CodeStyleCheckerDialog.__resetStatistics</h4>
800 <b>__resetStatistics</b>(<i></i>)
801
802 <p>
803 Private slot to reset the statistics data.
804 </p>
805 <a NAME="CodeStyleCheckerDialog.__resort" ID="CodeStyleCheckerDialog.__resort"></a>
806 <h4>CodeStyleCheckerDialog.__resort</h4>
807 <b>__resort</b>(<i></i>)
808
809 <p>
810 Private method to resort the tree.
811 </p>
812 <a NAME="CodeStyleCheckerDialog.__selectCodes" ID="CodeStyleCheckerDialog.__selectCodes"></a>
813 <h4>CodeStyleCheckerDialog.__selectCodes</h4>
814 <b>__selectCodes</b>(<i>edit, categories, showFixCodes</i>)
815
816 <p>
817 Private method to select message codes via a selection dialog.
818 </p>
819 <dl>
820
821 <dt><i>edit</i> (QLineEdit)</dt>
822 <dd>
823 reference of the line edit to be populated
824 </dd>
825 <dt><i>categories</i> (list of str)</dt>
826 <dd>
827 list of message categories to omit
828 </dd>
829 <dt><i>showFixCodes</i> (bool)</dt>
830 <dd>
831 flag indicating to show a list of fixable
832 issues
833 </dd>
834 </dl>
835 <a NAME="CodeStyleCheckerDialog.__updateFixerStatistics" ID="CodeStyleCheckerDialog.__updateFixerStatistics"></a>
836 <h4>CodeStyleCheckerDialog.__updateFixerStatistics</h4>
837 <b>__updateFixerStatistics</b>(<i>fixer</i>)
838
839 <p>
840 Private method to update the collected fixer related statistics.
841 </p>
842 <dl>
843
844 <dt><i>fixer</i> (CodeStyleFixer)</dt>
845 <dd>
846 reference to the code style fixer
847 </dd>
848 </dl>
849 <a NAME="CodeStyleCheckerDialog.__updateProgress" ID="CodeStyleCheckerDialog.__updateProgress"></a>
850 <h4>CodeStyleCheckerDialog.__updateProgress</h4>
851 <b>__updateProgress</b>(<i>fn</i>)
852
853 <p>
854 Private method to update the progress tab.
855 </p>
856 <dl>
857
858 <dt><i>fn</i> (str)</dt>
859 <dd>
860 filename of the just checked file
861 </dd>
862 </dl>
863 <a NAME="CodeStyleCheckerDialog.__updateStatistics" ID="CodeStyleCheckerDialog.__updateStatistics"></a>
864 <h4>CodeStyleCheckerDialog.__updateStatistics</h4>
865 <b>__updateStatistics</b>(<i>statistics, fixer, ignoredErrors, securityOk</i>)
866
867 <p>
868 Private method to update the collected statistics.
869 </p>
870 <dl>
871
872 <dt><i>statistics</i> (dict)</dt>
873 <dd>
874 dictionary of statistical data with
875 message code as key and message count as value
876 </dd>
877 <dt><i>fixer</i> (CodeStyleFixer)</dt>
878 <dd>
879 reference to the code style fixer
880 </dd>
881 <dt><i>ignoredErrors</i> (int)</dt>
882 <dd>
883 number of ignored errors
884 </dd>
885 <dt><i>securityOk</i> (int)</dt>
886 <dd>
887 number of acknowledged security reports
888 </dd>
889 </dl>
890 <a NAME="CodeStyleCheckerDialog.check" ID="CodeStyleCheckerDialog.check"></a>
891 <h4>CodeStyleCheckerDialog.check</h4>
892 <b>check</b>(<i>codestring=''</i>)
893
894 <p>
895 Public method to start a style check for one file.
896 </p>
897 <p>
898 The results are reported to the __processResult slot.
899 </p>
900 <dl>
901
902 <dt><i>codestring</i> (str)</dt>
903 <dd>
904 optional sourcestring
905 </dd>
906 </dl>
907 <a NAME="CodeStyleCheckerDialog.checkBatch" ID="CodeStyleCheckerDialog.checkBatch"></a>
908 <h4>CodeStyleCheckerDialog.checkBatch</h4>
909 <b>checkBatch</b>(<i></i>)
910
911 <p>
912 Public method to start a style check batch job.
913 </p>
914 <p>
915 The results are reported to the __processResult slot.
916 </p>
917 <a NAME="CodeStyleCheckerDialog.on_addBuiltinButton_clicked" ID="CodeStyleCheckerDialog.on_addBuiltinButton_clicked"></a>
918 <h4>CodeStyleCheckerDialog.on_addBuiltinButton_clicked</h4>
919 <b>on_addBuiltinButton_clicked</b>(<i></i>)
920
921 <p>
922 Private slot to add a built-in assignment to be ignored.
923 </p>
924 <a NAME="CodeStyleCheckerDialog.on_addWhitelistButton_clicked" ID="CodeStyleCheckerDialog.on_addWhitelistButton_clicked"></a>
925 <h4>CodeStyleCheckerDialog.on_addWhitelistButton_clicked</h4>
926 <b>on_addWhitelistButton_clicked</b>(<i></i>)
927
928 <p>
929 Private slot to add a commented code whitelist pattern.
930 </p>
931 <a NAME="CodeStyleCheckerDialog.on_builtinsAssignmentList_itemSelectionChanged" ID="CodeStyleCheckerDialog.on_builtinsAssignmentList_itemSelectionChanged"></a>
932 <h4>CodeStyleCheckerDialog.on_builtinsAssignmentList_itemSelectionChanged</h4>
933 <b>on_builtinsAssignmentList_itemSelectionChanged</b>(<i></i>)
934
935 <p>
936 Private slot to react upon changes of the selected builtin assignments.
937 </p>
938 <a NAME="CodeStyleCheckerDialog.on_buttonBox_clicked" ID="CodeStyleCheckerDialog.on_buttonBox_clicked"></a>
939 <h4>CodeStyleCheckerDialog.on_buttonBox_clicked</h4>
940 <b>on_buttonBox_clicked</b>(<i>button</i>)
941
942 <p>
943 Private slot called by a button of the button box clicked.
944 </p>
945 <dl>
946
947 <dt><i>button</i> (QAbstractButton)</dt>
948 <dd>
949 button that was clicked
950 </dd>
951 </dl>
952 <a NAME="CodeStyleCheckerDialog.on_cancelButton_clicked" ID="CodeStyleCheckerDialog.on_cancelButton_clicked"></a>
953 <h4>CodeStyleCheckerDialog.on_cancelButton_clicked</h4>
954 <b>on_cancelButton_clicked</b>(<i></i>)
955
956 <p>
957 Private slot to handle the "Cancel" button press.
958 </p>
959 <a NAME="CodeStyleCheckerDialog.on_deleteBuiltinButton_clicked" ID="CodeStyleCheckerDialog.on_deleteBuiltinButton_clicked"></a>
960 <h4>CodeStyleCheckerDialog.on_deleteBuiltinButton_clicked</h4>
961 <b>on_deleteBuiltinButton_clicked</b>(<i></i>)
962
963 <p>
964 Private slot to delete the selected items from the list.
965 </p>
966 <a NAME="CodeStyleCheckerDialog.on_deleteWhitelistButton_clicked" ID="CodeStyleCheckerDialog.on_deleteWhitelistButton_clicked"></a>
967 <h4>CodeStyleCheckerDialog.on_deleteWhitelistButton_clicked</h4>
968 <b>on_deleteWhitelistButton_clicked</b>(<i></i>)
969
970 <p>
971 Private slot to delete the selected items from the list.
972 </p>
973 <a NAME="CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked" ID="CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked"></a>
974 <h4>CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked</h4>
975 <b>on_excludeMessagesSelectButton_clicked</b>(<i></i>)
976
977 <p>
978 Private slot to select the message codes to be excluded via a
979 selection dialog.
980 </p>
981 <a NAME="CodeStyleCheckerDialog.on_filterButton_clicked" ID="CodeStyleCheckerDialog.on_filterButton_clicked"></a>
982 <h4>CodeStyleCheckerDialog.on_filterButton_clicked</h4>
983 <b>on_filterButton_clicked</b>(<i></i>)
984
985 <p>
986 Private slot to filter the list of messages based on selected message
987 code.
988 </p>
989 <a NAME="CodeStyleCheckerDialog.on_fixButton_clicked" ID="CodeStyleCheckerDialog.on_fixButton_clicked"></a>
990 <h4>CodeStyleCheckerDialog.on_fixButton_clicked</h4>
991 <b>on_fixButton_clicked</b>(<i></i>)
992
993 <p>
994 Private slot to fix selected issues.
995 </p>
996 <p>
997 Build a dictionary of issues to fix. Update the initialized __options.
998 Then call check with the dict as keyparam to fix selected issues.
999 </p>
1000 <a NAME="CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked" ID="CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked"></a>
1001 <h4>CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked</h4>
1002 <b>on_fixIssuesSelectButton_clicked</b>(<i></i>)
1003
1004 <p>
1005 Private slot to select the issue codes to be fixed via a
1006 selection dialog.
1007 </p>
1008 <a NAME="CodeStyleCheckerDialog.on_includeMessagesSelectButton_clicked" ID="CodeStyleCheckerDialog.on_includeMessagesSelectButton_clicked"></a>
1009 <h4>CodeStyleCheckerDialog.on_includeMessagesSelectButton_clicked</h4>
1010 <b>on_includeMessagesSelectButton_clicked</b>(<i></i>)
1011
1012 <p>
1013 Private slot to select the message codes to be included via a
1014 selection dialog.
1015 </p>
1016 <a NAME="CodeStyleCheckerDialog.on_loadDefaultButton_clicked" ID="CodeStyleCheckerDialog.on_loadDefaultButton_clicked"></a>
1017 <h4>CodeStyleCheckerDialog.on_loadDefaultButton_clicked</h4>
1018 <b>on_loadDefaultButton_clicked</b>(<i></i>)
1019
1020 <p>
1021 Private slot to load the default configuration values.
1022 </p>
1023 <a NAME="CodeStyleCheckerDialog.on_noFixIssuesSelectButton_clicked" ID="CodeStyleCheckerDialog.on_noFixIssuesSelectButton_clicked"></a>
1024 <h4>CodeStyleCheckerDialog.on_noFixIssuesSelectButton_clicked</h4>
1025 <b>on_noFixIssuesSelectButton_clicked</b>(<i></i>)
1026
1027 <p>
1028 Private slot to select the issue codes not to be fixed via a
1029 selection dialog.
1030 </p>
1031 <a NAME="CodeStyleCheckerDialog.on_resetDefaultButton_clicked" ID="CodeStyleCheckerDialog.on_resetDefaultButton_clicked"></a>
1032 <h4>CodeStyleCheckerDialog.on_resetDefaultButton_clicked</h4>
1033 <b>on_resetDefaultButton_clicked</b>(<i></i>)
1034
1035 <p>
1036 Private slot to reset the configuration values to their default values.
1037 </p>
1038 <a NAME="CodeStyleCheckerDialog.on_restartButton_clicked" ID="CodeStyleCheckerDialog.on_restartButton_clicked"></a>
1039 <h4>CodeStyleCheckerDialog.on_restartButton_clicked</h4>
1040 <b>on_restartButton_clicked</b>(<i></i>)
1041
1042 <p>
1043 Private slot to restart a code style check run.
1044 </p>
1045 <a NAME="CodeStyleCheckerDialog.on_resultList_itemActivated" ID="CodeStyleCheckerDialog.on_resultList_itemActivated"></a>
1046 <h4>CodeStyleCheckerDialog.on_resultList_itemActivated</h4>
1047 <b>on_resultList_itemActivated</b>(<i>item, column</i>)
1048
1049 <p>
1050 Private slot to handle the activation of an item.
1051 </p>
1052 <dl>
1053
1054 <dt><i>item</i> (QTreeWidgetItem)</dt>
1055 <dd>
1056 reference to the activated item
1057 </dd>
1058 <dt><i>column</i> (int)</dt>
1059 <dd>
1060 column the item was activated in
1061 </dd>
1062 </dl>
1063 <a NAME="CodeStyleCheckerDialog.on_resultList_itemSelectionChanged" ID="CodeStyleCheckerDialog.on_resultList_itemSelectionChanged"></a>
1064 <h4>CodeStyleCheckerDialog.on_resultList_itemSelectionChanged</h4>
1065 <b>on_resultList_itemSelectionChanged</b>(<i></i>)
1066
1067 <p>
1068 Private slot to change the dialog state depending on the selection.
1069 </p>
1070 <a NAME="CodeStyleCheckerDialog.on_showButton_clicked" ID="CodeStyleCheckerDialog.on_showButton_clicked"></a>
1071 <h4>CodeStyleCheckerDialog.on_showButton_clicked</h4>
1072 <b>on_showButton_clicked</b>(<i></i>)
1073
1074 <p>
1075 Private slot to handle the "Show" button press.
1076 </p>
1077 <a NAME="CodeStyleCheckerDialog.on_startButton_clicked" ID="CodeStyleCheckerDialog.on_startButton_clicked"></a>
1078 <h4>CodeStyleCheckerDialog.on_startButton_clicked</h4>
1079 <b>on_startButton_clicked</b>(<i></i>)
1080
1081 <p>
1082 Private slot to start a code style check run.
1083 </p>
1084 <a NAME="CodeStyleCheckerDialog.on_statisticsButton_clicked" ID="CodeStyleCheckerDialog.on_statisticsButton_clicked"></a>
1085 <h4>CodeStyleCheckerDialog.on_statisticsButton_clicked</h4>
1086 <b>on_statisticsButton_clicked</b>(<i></i>)
1087
1088 <p>
1089 Private slot to show the statistics dialog.
1090 </p>
1091 <a NAME="CodeStyleCheckerDialog.on_storeDefaultButton_clicked" ID="CodeStyleCheckerDialog.on_storeDefaultButton_clicked"></a>
1092 <h4>CodeStyleCheckerDialog.on_storeDefaultButton_clicked</h4>
1093 <b>on_storeDefaultButton_clicked</b>(<i></i>)
1094
1095 <p>
1096 Private slot to store the current configuration values as
1097 default values.
1098 </p>
1099 <a NAME="CodeStyleCheckerDialog.on_whitelistWidget_itemSelectionChanged" ID="CodeStyleCheckerDialog.on_whitelistWidget_itemSelectionChanged"></a>
1100 <h4>CodeStyleCheckerDialog.on_whitelistWidget_itemSelectionChanged</h4>
1101 <b>on_whitelistWidget_itemSelectionChanged</b>(<i></i>)
1102
1103 <p>
1104 Private slot to react upon changes of the selected whitelist patterns.
1105 </p>
1106 <a NAME="CodeStyleCheckerDialog.prepare" ID="CodeStyleCheckerDialog.prepare"></a>
1107 <h4>CodeStyleCheckerDialog.prepare</h4>
1108 <b>prepare</b>(<i>fileList, project</i>)
1109
1110 <p>
1111 Public method to prepare the dialog with a list of filenames.
1112 </p>
1113 <dl>
1114
1115 <dt><i>fileList</i> (list of str)</dt>
1116 <dd>
1117 list of filenames
1118 </dd>
1119 <dt><i>project</i> (Project)</dt>
1120 <dd>
1121 reference to the project object
1122 </dd>
1123 </dl>
1124 <a NAME="CodeStyleCheckerDialog.start" ID="CodeStyleCheckerDialog.start"></a>
1125 <h4>CodeStyleCheckerDialog.start</h4>
1126 <b>start</b>(<i>fn, save=False, repeat=None</i>)
1127
1128 <p>
1129 Public slot to start the code style check.
1130 </p>
1131 <dl>
1132
1133 <dt><i>fn</i> (str or list of str)</dt>
1134 <dd>
1135 file or list of files or directory to be checked
1136 </dd>
1137 <dt><i>save</i> (bool)</dt>
1138 <dd>
1139 flag indicating to save the given file/file list/directory
1140 </dd>
1141 <dt><i>repeat</i> (None or bool)</dt>
1142 <dd>
1143 state of the repeat check box if it is not None
1144 </dd>
1145 </dl>
1146 <div align="right"><a href="#top">Up</a></div>
1147 <hr />
1148 </body></html>

eric ide

mercurial