70 <td>Private method to create an entry in the result list.</td> |
67 <td>Private method to create an entry in the result list.</td> |
71 </tr><tr> |
68 </tr><tr> |
72 <td><a href="#CodeStyleCheckerDialog.__finish">__finish</a></td> |
69 <td><a href="#CodeStyleCheckerDialog.__finish">__finish</a></td> |
73 <td>Private slot called when the code style check finished or the user pressed the cancel button.</td> |
70 <td>Private slot called when the code style check finished or the user pressed the cancel button.</td> |
74 </tr><tr> |
71 </tr><tr> |
|
72 <td><a href="#CodeStyleCheckerDialog.__getEol">__getEol</a></td> |
|
73 <td>Private method to get the applicable eol string.</td> |
|
74 </tr><tr> |
75 <td><a href="#CodeStyleCheckerDialog.__getSelectedFixableItems">__getSelectedFixableItems</a></td> |
75 <td><a href="#CodeStyleCheckerDialog.__getSelectedFixableItems">__getSelectedFixableItems</a></td> |
76 <td>Private method to extract all selected items for fixable issues.</td> |
76 <td>Private method to extract all selected items for fixable issues.</td> |
77 </tr><tr> |
77 </tr><tr> |
78 <td><a href="#CodeStyleCheckerDialog.__itemFixable">__itemFixable</a></td> |
78 <td><a href="#CodeStyleCheckerDialog.__itemFixable">__itemFixable</a></td> |
79 <td>Private method to check, if an item has a fixable issue.</td> |
79 <td>Private method to check, if an item has a fixable issue.</td> |
80 </tr><tr> |
80 </tr><tr> |
81 <td><a href="#CodeStyleCheckerDialog.__modifyFixedResultItem">__modifyFixedResultItem</a></td> |
81 <td><a href="#CodeStyleCheckerDialog.__modifyFixedResultItem">__modifyFixedResultItem</a></td> |
82 <td>Private method to modify a result list entry to show its positive fixed state.</td> |
82 <td>Private method to modify a result list entry to show its positive fixed state.</td> |
83 </tr><tr> |
83 </tr><tr> |
|
84 <td><a href="#CodeStyleCheckerDialog.__processResult">__processResult</a></td> |
|
85 <td>Privat slot called after perfoming a style check on one file.</td> |
|
86 </tr><tr> |
84 <td><a href="#CodeStyleCheckerDialog.__resetStatistics">__resetStatistics</a></td> |
87 <td><a href="#CodeStyleCheckerDialog.__resetStatistics">__resetStatistics</a></td> |
85 <td>Private slot to reset the statistics data.</td> |
88 <td>Private slot to reset the statistics data.</td> |
86 </tr><tr> |
89 </tr><tr> |
87 <td><a href="#CodeStyleCheckerDialog.__resort">__resort</a></td> |
90 <td><a href="#CodeStyleCheckerDialog.__resort">__resort</a></td> |
88 <td>Private method to resort the tree.</td> |
91 <td>Private method to resort the tree.</td> |
93 <td><a href="#CodeStyleCheckerDialog.__updateFixerStatistics">__updateFixerStatistics</a></td> |
96 <td><a href="#CodeStyleCheckerDialog.__updateFixerStatistics">__updateFixerStatistics</a></td> |
94 <td>Private method to update the collected fixer related statistics.</td> |
97 <td>Private method to update the collected fixer related statistics.</td> |
95 </tr><tr> |
98 </tr><tr> |
96 <td><a href="#CodeStyleCheckerDialog.__updateStatistics">__updateStatistics</a></td> |
99 <td><a href="#CodeStyleCheckerDialog.__updateStatistics">__updateStatistics</a></td> |
97 <td>Private method to update the collected statistics.</td> |
100 <td>Private method to update the collected statistics.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#CodeStyleCheckerDialog.check">check</a></td> |
|
103 <td>Start a style check for one file.</td> |
98 </tr><tr> |
104 </tr><tr> |
99 <td><a href="#CodeStyleCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
105 <td><a href="#CodeStyleCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
100 <td>Private slot called by a button of the button box clicked.</td> |
106 <td>Private slot called by a button of the button box clicked.</td> |
101 </tr><tr> |
107 </tr><tr> |
102 <td><a href="#CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked">on_excludeMessagesSelectButton_clicked</a></td> |
108 <td><a href="#CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked">on_excludeMessagesSelectButton_clicked</a></td> |
149 <table> |
155 <table> |
150 <tr><td>None</td></tr> |
156 <tr><td>None</td></tr> |
151 </table> |
157 </table> |
152 <a NAME="CodeStyleCheckerDialog.__init__" ID="CodeStyleCheckerDialog.__init__"></a> |
158 <a NAME="CodeStyleCheckerDialog.__init__" ID="CodeStyleCheckerDialog.__init__"></a> |
153 <h4>CodeStyleCheckerDialog (Constructor)</h4> |
159 <h4>CodeStyleCheckerDialog (Constructor)</h4> |
154 <b>CodeStyleCheckerDialog</b>(<i>parent=None</i>) |
160 <b>CodeStyleCheckerDialog</b>(<i>styleCheckService, parent=None</i>) |
155 <p> |
161 <p> |
156 Constructor |
162 Constructor |
157 </p><dl> |
163 </p><dl> |
158 <dt><i>parent</i></dt> |
164 <dt><i>styleCheckService</i></dt> |
|
165 <dd> |
|
166 reference to the service |
|
167 (CodeStyleCheckService) |
|
168 </dd><dt><i>parent</i></dt> |
159 <dd> |
169 <dd> |
160 reference to the parent widget (QWidget) |
170 reference to the parent widget (QWidget) |
161 </dd> |
171 </dd> |
162 </dl><a NAME="CodeStyleCheckerDialog.__clearErrors" ID="CodeStyleCheckerDialog.__clearErrors"></a> |
172 </dl><a NAME="CodeStyleCheckerDialog.__clearErrors" ID="CodeStyleCheckerDialog.__clearErrors"></a> |
163 <h4>CodeStyleCheckerDialog.__clearErrors</h4> |
173 <h4>CodeStyleCheckerDialog.__clearErrors</h4> |
205 <h4>CodeStyleCheckerDialog.__finish</h4> |
215 <h4>CodeStyleCheckerDialog.__finish</h4> |
206 <b>__finish</b>(<i></i>) |
216 <b>__finish</b>(<i></i>) |
207 <p> |
217 <p> |
208 Private slot called when the code style check finished or the user |
218 Private slot called when the code style check finished or the user |
209 pressed the cancel button. |
219 pressed the cancel button. |
210 </p><a NAME="CodeStyleCheckerDialog.__getSelectedFixableItems" ID="CodeStyleCheckerDialog.__getSelectedFixableItems"></a> |
220 </p><a NAME="CodeStyleCheckerDialog.__getEol" ID="CodeStyleCheckerDialog.__getEol"></a> |
|
221 <h4>CodeStyleCheckerDialog.__getEol</h4> |
|
222 <b>__getEol</b>(<i>fn</i>) |
|
223 <p> |
|
224 Private method to get the applicable eol string. |
|
225 </p><dl> |
|
226 <dt><i>fn</i></dt> |
|
227 <dd> |
|
228 filename where to determine the line ending (str) |
|
229 </dd> |
|
230 </dl><dl> |
|
231 <dt>Returns:</dt> |
|
232 <dd> |
|
233 eol string (string) |
|
234 </dd> |
|
235 </dl><a NAME="CodeStyleCheckerDialog.__getSelectedFixableItems" ID="CodeStyleCheckerDialog.__getSelectedFixableItems"></a> |
211 <h4>CodeStyleCheckerDialog.__getSelectedFixableItems</h4> |
236 <h4>CodeStyleCheckerDialog.__getSelectedFixableItems</h4> |
212 <b>__getSelectedFixableItems</b>(<i></i>) |
237 <b>__getSelectedFixableItems</b>(<i></i>) |
213 <p> |
238 <p> |
214 Private method to extract all selected items for fixable issues. |
239 Private method to extract all selected items for fixable issues. |
215 </p><dl> |
240 </p><dl> |
246 <dd> |
271 <dd> |
247 text to be appended (string) |
272 text to be appended (string) |
248 </dd><dt><i>fixed</i></dt> |
273 </dd><dt><i>fixed</i></dt> |
249 <dd> |
274 <dd> |
250 flag indicating a fixed issue (boolean) |
275 flag indicating a fixed issue (boolean) |
|
276 </dd> |
|
277 </dl><a NAME="CodeStyleCheckerDialog.__processResult" ID="CodeStyleCheckerDialog.__processResult"></a> |
|
278 <h4>CodeStyleCheckerDialog.__processResult</h4> |
|
279 <b>__processResult</b>(<i>fn, codeStyleCheckerStats, fixes, results</i>) |
|
280 <p> |
|
281 Privat slot called after perfoming a style check on one file. |
|
282 </p><dl> |
|
283 <dt><i>fn</i></dt> |
|
284 <dd> |
|
285 filename of the just checked file (str) |
|
286 </dd><dt><i>codeStyleCheckerStats</i></dt> |
|
287 <dd> |
|
288 stats of style and name check (dict) |
|
289 </dd><dt><i>fixes</i></dt> |
|
290 <dd> |
|
291 number of applied fixes (int) |
|
292 </dd><dt><i>results</i></dt> |
|
293 <dd> |
|
294 tuple for each found violation of style (tuple of |
|
295 lineno (int), position (int), text (str), fixed (bool), |
|
296 autofixing (bool)) |
251 </dd> |
297 </dd> |
252 </dl><a NAME="CodeStyleCheckerDialog.__resetStatistics" ID="CodeStyleCheckerDialog.__resetStatistics"></a> |
298 </dl><a NAME="CodeStyleCheckerDialog.__resetStatistics" ID="CodeStyleCheckerDialog.__resetStatistics"></a> |
253 <h4>CodeStyleCheckerDialog.__resetStatistics</h4> |
299 <h4>CodeStyleCheckerDialog.__resetStatistics</h4> |
254 <b>__resetStatistics</b>(<i></i>) |
300 <b>__resetStatistics</b>(<i></i>) |
255 <p> |
301 <p> |
294 dictionary of statistical data with |
340 dictionary of statistical data with |
295 message code as key and message count as value |
341 message code as key and message count as value |
296 </dd><dt><i>fixer</i></dt> |
342 </dd><dt><i>fixer</i></dt> |
297 <dd> |
343 <dd> |
298 reference to the code style fixer (CodeStyleFixer) |
344 reference to the code style fixer (CodeStyleFixer) |
|
345 </dd> |
|
346 </dl><a NAME="CodeStyleCheckerDialog.check" ID="CodeStyleCheckerDialog.check"></a> |
|
347 <h4>CodeStyleCheckerDialog.check</h4> |
|
348 <b>check</b>(<i>codestring='', onlyFixes={}</i>) |
|
349 <p> |
|
350 Start a style check for one file. |
|
351 </p><p> |
|
352 The results are reported to the __processResult slot. |
|
353 </p><dl> |
|
354 <dt><i>codestring=</i></dt> |
|
355 <dd> |
|
356 optional sourcestring (str) |
|
357 </dd><dt><i>onlyFixes=</i></dt> |
|
358 <dd> |
|
359 dict which violations should be fixed (dict) |
299 </dd> |
360 </dd> |
300 </dl><a NAME="CodeStyleCheckerDialog.on_buttonBox_clicked" ID="CodeStyleCheckerDialog.on_buttonBox_clicked"></a> |
361 </dl><a NAME="CodeStyleCheckerDialog.on_buttonBox_clicked" ID="CodeStyleCheckerDialog.on_buttonBox_clicked"></a> |
301 <h4>CodeStyleCheckerDialog.on_buttonBox_clicked</h4> |
362 <h4>CodeStyleCheckerDialog.on_buttonBox_clicked</h4> |
302 <b>on_buttonBox_clicked</b>(<i>button</i>) |
363 <b>on_buttonBox_clicked</b>(<i>button</i>) |
303 <p> |
364 <p> |
316 </p><a NAME="CodeStyleCheckerDialog.on_fixButton_clicked" ID="CodeStyleCheckerDialog.on_fixButton_clicked"></a> |
377 </p><a NAME="CodeStyleCheckerDialog.on_fixButton_clicked" ID="CodeStyleCheckerDialog.on_fixButton_clicked"></a> |
317 <h4>CodeStyleCheckerDialog.on_fixButton_clicked</h4> |
378 <h4>CodeStyleCheckerDialog.on_fixButton_clicked</h4> |
318 <b>on_fixButton_clicked</b>(<i></i>) |
379 <b>on_fixButton_clicked</b>(<i></i>) |
319 <p> |
380 <p> |
320 Private slot to fix selected issues. |
381 Private slot to fix selected issues. |
|
382 </p><p> |
|
383 Build a dictionary of issues to fix. Update the initialized __options. |
|
384 Then call check with the dict as keyparam to fix selected issues. |
321 </p><a NAME="CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked" ID="CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked"></a> |
385 </p><a NAME="CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked" ID="CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked"></a> |
322 <h4>CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked</h4> |
386 <h4>CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked</h4> |
323 <b>on_fixIssuesSelectButton_clicked</b>(<i></i>) |
387 <b>on_fixIssuesSelectButton_clicked</b>(<i></i>) |
324 <p> |
388 <p> |
325 Private slot to select the issue codes to be fixed via a |
389 Private slot to select the issue codes to be fixed via a |
417 state of the repeat check box if it is not None |
481 state of the repeat check box if it is not None |
418 (None or boolean) |
482 (None or boolean) |
419 </dd> |
483 </dd> |
420 </dl> |
484 </dl> |
421 <div align="right"><a href="#top">Up</a></div> |
485 <div align="right"><a href="#top">Up</a></div> |
422 <hr /><hr /> |
|
423 <a NAME="CodeStyleCheckerReport" ID="CodeStyleCheckerReport"></a> |
|
424 <h2>CodeStyleCheckerReport</h2> |
|
425 <p> |
|
426 Class implementing a special report to be used with our dialog. |
|
427 </p> |
|
428 <h3>Derived from</h3> |
|
429 pep8.BaseReport |
|
430 <h3>Class Attributes</h3> |
|
431 <table> |
|
432 <tr><td>None</td></tr> |
|
433 </table> |
|
434 <h3>Class Methods</h3> |
|
435 <table> |
|
436 <tr><td>None</td></tr> |
|
437 </table> |
|
438 <h3>Methods</h3> |
|
439 <table> |
|
440 <tr> |
|
441 <td><a href="#CodeStyleCheckerReport.__init__">CodeStyleCheckerReport</a></td> |
|
442 <td>Constructor</td> |
|
443 </tr><tr> |
|
444 <td><a href="#CodeStyleCheckerReport.error_args">error_args</a></td> |
|
445 <td>Public method to collect the error messages.</td> |
|
446 </tr> |
|
447 </table> |
|
448 <h3>Static Methods</h3> |
|
449 <table> |
|
450 <tr><td>None</td></tr> |
|
451 </table> |
|
452 <a NAME="CodeStyleCheckerReport.__init__" ID="CodeStyleCheckerReport.__init__"></a> |
|
453 <h4>CodeStyleCheckerReport (Constructor)</h4> |
|
454 <b>CodeStyleCheckerReport</b>(<i>options</i>) |
|
455 <p> |
|
456 Constructor |
|
457 </p><dl> |
|
458 <dt><i>options</i></dt> |
|
459 <dd> |
|
460 options for the report (optparse.Values) |
|
461 </dd> |
|
462 </dl><a NAME="CodeStyleCheckerReport.error_args" ID="CodeStyleCheckerReport.error_args"></a> |
|
463 <h4>CodeStyleCheckerReport.error_args</h4> |
|
464 <b>error_args</b>(<i>line_number, offset, code, check, *args</i>) |
|
465 <p> |
|
466 Public method to collect the error messages. |
|
467 </p><dl> |
|
468 <dt><i>line_number</i></dt> |
|
469 <dd> |
|
470 line number of the issue (integer) |
|
471 </dd><dt><i>offset</i></dt> |
|
472 <dd> |
|
473 position within line of the issue (integer) |
|
474 </dd><dt><i>code</i></dt> |
|
475 <dd> |
|
476 message code (string) |
|
477 </dd><dt><i>check</i></dt> |
|
478 <dd> |
|
479 reference to the checker function (function) |
|
480 </dd><dt><i>args</i></dt> |
|
481 <dd> |
|
482 arguments for the message (list) |
|
483 </dd> |
|
484 </dl><dl> |
|
485 <dt>Returns:</dt> |
|
486 <dd> |
|
487 error code (string) |
|
488 </dd> |
|
489 </dl> |
|
490 <div align="right"><a href="#top">Up</a></div> |
|
491 <hr /> |
486 <hr /> |
492 </body></html> |
487 </body></html> |