|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.PluginCodeStyleChecker</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.PluginCodeStyleChecker</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the code style checker plug-in. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>author</td></tr><tr><td>autoactivate</td></tr><tr><td>className</td></tr><tr><td>deactivateable</td></tr><tr><td>error</td></tr><tr><td>longDescription</td></tr><tr><td>name</td></tr><tr><td>packageName</td></tr><tr><td>pyqtApi</td></tr><tr><td>shortDescription</td></tr><tr><td>version</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#CodeStyleCheckerPlugin">CodeStyleCheckerPlugin</a></td> |
|
39 <td>Class implementing the code style checker plug-in.</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="CodeStyleCheckerPlugin" ID="CodeStyleCheckerPlugin"></a> |
|
50 <h2>CodeStyleCheckerPlugin</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing the code style checker plug-in. |
|
54 </p> |
|
55 <h3>Signals</h3> |
|
56 <dl> |
|
57 |
|
58 <dt>batchFinished()</dt> |
|
59 <dd> |
|
60 emitted when a style check batch is done |
|
61 </dd> |
|
62 <dt>error(str, str)</dt> |
|
63 <dd> |
|
64 emitted in case of an error |
|
65 </dd> |
|
66 <dt>styleChecked(str, dict, int, list)</dt> |
|
67 <dd> |
|
68 emitted when the style check was |
|
69 done for a file. |
|
70 </dd> |
|
71 </dl> |
|
72 <h3>Derived from</h3> |
|
73 QObject |
|
74 <h3>Class Attributes</h3> |
|
75 |
|
76 <table> |
|
77 <tr><td>None</td></tr> |
|
78 </table> |
|
79 <h3>Class Methods</h3> |
|
80 |
|
81 <table> |
|
82 <tr><td>None</td></tr> |
|
83 </table> |
|
84 <h3>Methods</h3> |
|
85 |
|
86 <table> |
|
87 |
|
88 <tr> |
|
89 <td><a href="#CodeStyleCheckerPlugin.__init__">CodeStyleCheckerPlugin</a></td> |
|
90 <td>Constructor</td> |
|
91 </tr> |
|
92 <tr> |
|
93 <td><a href="#CodeStyleCheckerPlugin.__editorClosed">__editorClosed</a></td> |
|
94 <td>Private slot called, when an editor was closed.</td> |
|
95 </tr> |
|
96 <tr> |
|
97 <td><a href="#CodeStyleCheckerPlugin.__editorCodeStyleCheck">__editorCodeStyleCheck</a></td> |
|
98 <td>Private slot to handle the code style check context menu action of the editors.</td> |
|
99 </tr> |
|
100 <tr> |
|
101 <td><a href="#CodeStyleCheckerPlugin.__editorOpened">__editorOpened</a></td> |
|
102 <td>Private slot called, when a new editor was opened.</td> |
|
103 </tr> |
|
104 <tr> |
|
105 <td><a href="#CodeStyleCheckerPlugin.__editorShowMenu">__editorShowMenu</a></td> |
|
106 <td>Private slot called, when the the editor context menu or a submenu is about to be shown.</td> |
|
107 </tr> |
|
108 <tr> |
|
109 <td><a href="#CodeStyleCheckerPlugin.__initialize">__initialize</a></td> |
|
110 <td>Private slot to (re)initialize the plugin.</td> |
|
111 </tr> |
|
112 <tr> |
|
113 <td><a href="#CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck">__projectBrowserCodeStyleCheck</a></td> |
|
114 <td>Private method to handle the code style check context menu action of the project sources browser.</td> |
|
115 </tr> |
|
116 <tr> |
|
117 <td><a href="#CodeStyleCheckerPlugin.__projectBrowserShowMenu">__projectBrowserShowMenu</a></td> |
|
118 <td>Private slot called, when the the project browser menu or a submenu is about to be shown.</td> |
|
119 </tr> |
|
120 <tr> |
|
121 <td><a href="#CodeStyleCheckerPlugin.__projectCodeStyleCheck">__projectCodeStyleCheck</a></td> |
|
122 <td>Private slot used to check the project files for code style.</td> |
|
123 </tr> |
|
124 <tr> |
|
125 <td><a href="#CodeStyleCheckerPlugin.__projectShowMenu">__projectShowMenu</a></td> |
|
126 <td>Private slot called, when the the project menu or a submenu is about to be shown.</td> |
|
127 </tr> |
|
128 <tr> |
|
129 <td><a href="#CodeStyleCheckerPlugin.__serviceError">__serviceError</a></td> |
|
130 <td>Private slot handling service errors.</td> |
|
131 </tr> |
|
132 <tr> |
|
133 <td><a href="#CodeStyleCheckerPlugin.__translateStyleCheck">__translateStyleCheck</a></td> |
|
134 <td>Private slot called after perfoming a style check on one file.</td> |
|
135 </tr> |
|
136 <tr> |
|
137 <td><a href="#CodeStyleCheckerPlugin.activate">activate</a></td> |
|
138 <td>Public method to activate this plugin.</td> |
|
139 </tr> |
|
140 <tr> |
|
141 <td><a href="#CodeStyleCheckerPlugin.batchJobDone">batchJobDone</a></td> |
|
142 <td>Public slot handling the completion of a batch job.</td> |
|
143 </tr> |
|
144 <tr> |
|
145 <td><a href="#CodeStyleCheckerPlugin.cancelStyleBatchCheck">cancelStyleBatchCheck</a></td> |
|
146 <td>Public method to cancel all batch jobs.</td> |
|
147 </tr> |
|
148 <tr> |
|
149 <td><a href="#CodeStyleCheckerPlugin.deactivate">deactivate</a></td> |
|
150 <td>Public method to deactivate this plugin.</td> |
|
151 </tr> |
|
152 <tr> |
|
153 <td><a href="#CodeStyleCheckerPlugin.serviceErrorPy3">serviceErrorPy3</a></td> |
|
154 <td>Public slot handling service errors for Python 3.</td> |
|
155 </tr> |
|
156 <tr> |
|
157 <td><a href="#CodeStyleCheckerPlugin.styleBatchCheck">styleBatchCheck</a></td> |
|
158 <td>Public method to prepare a style check on multiple Python source files.</td> |
|
159 </tr> |
|
160 <tr> |
|
161 <td><a href="#CodeStyleCheckerPlugin.styleCheck">styleCheck</a></td> |
|
162 <td>Public method to prepare a style check on one Python source file.</td> |
|
163 </tr> |
|
164 </table> |
|
165 <h3>Static Methods</h3> |
|
166 |
|
167 <table> |
|
168 <tr><td>None</td></tr> |
|
169 </table> |
|
170 |
|
171 <a NAME="CodeStyleCheckerPlugin.__init__" ID="CodeStyleCheckerPlugin.__init__"></a> |
|
172 <h4>CodeStyleCheckerPlugin (Constructor)</h4> |
|
173 <b>CodeStyleCheckerPlugin</b>(<i>ui</i>) |
|
174 |
|
175 <p> |
|
176 Constructor |
|
177 </p> |
|
178 <dl> |
|
179 |
|
180 <dt><i>ui</i></dt> |
|
181 <dd> |
|
182 reference to the user interface object (UI.UserInterface) |
|
183 </dd> |
|
184 </dl> |
|
185 <a NAME="CodeStyleCheckerPlugin.__editorClosed" ID="CodeStyleCheckerPlugin.__editorClosed"></a> |
|
186 <h4>CodeStyleCheckerPlugin.__editorClosed</h4> |
|
187 <b>__editorClosed</b>(<i>editor</i>) |
|
188 |
|
189 <p> |
|
190 Private slot called, when an editor was closed. |
|
191 </p> |
|
192 <dl> |
|
193 |
|
194 <dt><i>editor</i></dt> |
|
195 <dd> |
|
196 reference to the editor (QScintilla.Editor) |
|
197 </dd> |
|
198 </dl> |
|
199 <a NAME="CodeStyleCheckerPlugin.__editorCodeStyleCheck" ID="CodeStyleCheckerPlugin.__editorCodeStyleCheck"></a> |
|
200 <h4>CodeStyleCheckerPlugin.__editorCodeStyleCheck</h4> |
|
201 <b>__editorCodeStyleCheck</b>(<i></i>) |
|
202 |
|
203 <p> |
|
204 Private slot to handle the code style check context menu action |
|
205 of the editors. |
|
206 </p> |
|
207 <a NAME="CodeStyleCheckerPlugin.__editorOpened" ID="CodeStyleCheckerPlugin.__editorOpened"></a> |
|
208 <h4>CodeStyleCheckerPlugin.__editorOpened</h4> |
|
209 <b>__editorOpened</b>(<i>editor</i>) |
|
210 |
|
211 <p> |
|
212 Private slot called, when a new editor was opened. |
|
213 </p> |
|
214 <dl> |
|
215 |
|
216 <dt><i>editor</i></dt> |
|
217 <dd> |
|
218 reference to the new editor (QScintilla.Editor) |
|
219 </dd> |
|
220 </dl> |
|
221 <a NAME="CodeStyleCheckerPlugin.__editorShowMenu" ID="CodeStyleCheckerPlugin.__editorShowMenu"></a> |
|
222 <h4>CodeStyleCheckerPlugin.__editorShowMenu</h4> |
|
223 <b>__editorShowMenu</b>(<i>menuName, menu, editor</i>) |
|
224 |
|
225 <p> |
|
226 Private slot called, when the the editor context menu or a submenu is |
|
227 about to be shown. |
|
228 </p> |
|
229 <dl> |
|
230 |
|
231 <dt><i>menuName</i></dt> |
|
232 <dd> |
|
233 name of the menu to be shown (string) |
|
234 </dd> |
|
235 <dt><i>menu</i></dt> |
|
236 <dd> |
|
237 reference to the menu (QMenu) |
|
238 </dd> |
|
239 <dt><i>editor</i></dt> |
|
240 <dd> |
|
241 reference to the editor |
|
242 </dd> |
|
243 </dl> |
|
244 <a NAME="CodeStyleCheckerPlugin.__initialize" ID="CodeStyleCheckerPlugin.__initialize"></a> |
|
245 <h4>CodeStyleCheckerPlugin.__initialize</h4> |
|
246 <b>__initialize</b>(<i></i>) |
|
247 |
|
248 <p> |
|
249 Private slot to (re)initialize the plugin. |
|
250 </p> |
|
251 <a NAME="CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck" ID="CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck"></a> |
|
252 <h4>CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck</h4> |
|
253 <b>__projectBrowserCodeStyleCheck</b>(<i></i>) |
|
254 |
|
255 <p> |
|
256 Private method to handle the code style check context menu action of |
|
257 the project sources browser. |
|
258 </p> |
|
259 <a NAME="CodeStyleCheckerPlugin.__projectBrowserShowMenu" ID="CodeStyleCheckerPlugin.__projectBrowserShowMenu"></a> |
|
260 <h4>CodeStyleCheckerPlugin.__projectBrowserShowMenu</h4> |
|
261 <b>__projectBrowserShowMenu</b>(<i>menuName, menu</i>) |
|
262 |
|
263 <p> |
|
264 Private slot called, when the the project browser menu or a submenu is |
|
265 about to be shown. |
|
266 </p> |
|
267 <dl> |
|
268 |
|
269 <dt><i>menuName</i></dt> |
|
270 <dd> |
|
271 name of the menu to be shown (string) |
|
272 </dd> |
|
273 <dt><i>menu</i></dt> |
|
274 <dd> |
|
275 reference to the menu (QMenu) |
|
276 </dd> |
|
277 </dl> |
|
278 <a NAME="CodeStyleCheckerPlugin.__projectCodeStyleCheck" ID="CodeStyleCheckerPlugin.__projectCodeStyleCheck"></a> |
|
279 <h4>CodeStyleCheckerPlugin.__projectCodeStyleCheck</h4> |
|
280 <b>__projectCodeStyleCheck</b>(<i></i>) |
|
281 |
|
282 <p> |
|
283 Private slot used to check the project files for code style. |
|
284 </p> |
|
285 <a NAME="CodeStyleCheckerPlugin.__projectShowMenu" ID="CodeStyleCheckerPlugin.__projectShowMenu"></a> |
|
286 <h4>CodeStyleCheckerPlugin.__projectShowMenu</h4> |
|
287 <b>__projectShowMenu</b>(<i>menuName, menu</i>) |
|
288 |
|
289 <p> |
|
290 Private slot called, when the the project menu or a submenu is |
|
291 about to be shown. |
|
292 </p> |
|
293 <dl> |
|
294 |
|
295 <dt><i>menuName</i></dt> |
|
296 <dd> |
|
297 name of the menu to be shown (string) |
|
298 </dd> |
|
299 <dt><i>menu</i></dt> |
|
300 <dd> |
|
301 reference to the menu (QMenu) |
|
302 </dd> |
|
303 </dl> |
|
304 <a NAME="CodeStyleCheckerPlugin.__serviceError" ID="CodeStyleCheckerPlugin.__serviceError"></a> |
|
305 <h4>CodeStyleCheckerPlugin.__serviceError</h4> |
|
306 <b>__serviceError</b>(<i>fn, msg</i>) |
|
307 |
|
308 <p> |
|
309 Private slot handling service errors. |
|
310 </p> |
|
311 <dl> |
|
312 |
|
313 <dt><i>fn</i></dt> |
|
314 <dd> |
|
315 file name (string) |
|
316 </dd> |
|
317 <dt><i>msg</i></dt> |
|
318 <dd> |
|
319 message text (string) |
|
320 </dd> |
|
321 </dl> |
|
322 <a NAME="CodeStyleCheckerPlugin.__translateStyleCheck" ID="CodeStyleCheckerPlugin.__translateStyleCheck"></a> |
|
323 <h4>CodeStyleCheckerPlugin.__translateStyleCheck</h4> |
|
324 <b>__translateStyleCheck</b>(<i>fn, codeStyleCheckerStats, results</i>) |
|
325 |
|
326 <p> |
|
327 Private slot called after perfoming a style check on one file. |
|
328 </p> |
|
329 <dl> |
|
330 |
|
331 <dt><i>fn</i> (str)</dt> |
|
332 <dd> |
|
333 filename of the just checked file |
|
334 </dd> |
|
335 <dt><i>codeStyleCheckerStats</i> (dict)</dt> |
|
336 <dd> |
|
337 stats of style and name check |
|
338 </dd> |
|
339 <dt><i>results</i> (dict)</dt> |
|
340 <dd> |
|
341 dictionary containing the check result data |
|
342 (see CodesStyleChecker.__checkCodeStyle for details) |
|
343 </dd> |
|
344 </dl> |
|
345 <a NAME="CodeStyleCheckerPlugin.activate" ID="CodeStyleCheckerPlugin.activate"></a> |
|
346 <h4>CodeStyleCheckerPlugin.activate</h4> |
|
347 <b>activate</b>(<i></i>) |
|
348 |
|
349 <p> |
|
350 Public method to activate this plugin. |
|
351 </p> |
|
352 <dl> |
|
353 <dt>Return:</dt> |
|
354 <dd> |
|
355 tuple of None and activation status (boolean) |
|
356 </dd> |
|
357 </dl> |
|
358 <a NAME="CodeStyleCheckerPlugin.batchJobDone" ID="CodeStyleCheckerPlugin.batchJobDone"></a> |
|
359 <h4>CodeStyleCheckerPlugin.batchJobDone</h4> |
|
360 <b>batchJobDone</b>(<i>fx, lang</i>) |
|
361 |
|
362 <p> |
|
363 Public slot handling the completion of a batch job. |
|
364 </p> |
|
365 <dl> |
|
366 |
|
367 <dt><i>fx</i></dt> |
|
368 <dd> |
|
369 service name (string) |
|
370 </dd> |
|
371 <dt><i>lang</i></dt> |
|
372 <dd> |
|
373 language (string) |
|
374 </dd> |
|
375 </dl> |
|
376 <a NAME="CodeStyleCheckerPlugin.cancelStyleBatchCheck" ID="CodeStyleCheckerPlugin.cancelStyleBatchCheck"></a> |
|
377 <h4>CodeStyleCheckerPlugin.cancelStyleBatchCheck</h4> |
|
378 <b>cancelStyleBatchCheck</b>(<i></i>) |
|
379 |
|
380 <p> |
|
381 Public method to cancel all batch jobs. |
|
382 </p> |
|
383 <a NAME="CodeStyleCheckerPlugin.deactivate" ID="CodeStyleCheckerPlugin.deactivate"></a> |
|
384 <h4>CodeStyleCheckerPlugin.deactivate</h4> |
|
385 <b>deactivate</b>(<i></i>) |
|
386 |
|
387 <p> |
|
388 Public method to deactivate this plugin. |
|
389 </p> |
|
390 <a NAME="CodeStyleCheckerPlugin.serviceErrorPy3" ID="CodeStyleCheckerPlugin.serviceErrorPy3"></a> |
|
391 <h4>CodeStyleCheckerPlugin.serviceErrorPy3</h4> |
|
392 <b>serviceErrorPy3</b>(<i>fx, lang, fn, msg</i>) |
|
393 |
|
394 <p> |
|
395 Public slot handling service errors for Python 3. |
|
396 </p> |
|
397 <dl> |
|
398 |
|
399 <dt><i>fx</i></dt> |
|
400 <dd> |
|
401 service name (string) |
|
402 </dd> |
|
403 <dt><i>lang</i></dt> |
|
404 <dd> |
|
405 language (string) |
|
406 </dd> |
|
407 <dt><i>fn</i></dt> |
|
408 <dd> |
|
409 file name (string) |
|
410 </dd> |
|
411 <dt><i>msg</i></dt> |
|
412 <dd> |
|
413 message text (string) |
|
414 </dd> |
|
415 </dl> |
|
416 <a NAME="CodeStyleCheckerPlugin.styleBatchCheck" ID="CodeStyleCheckerPlugin.styleBatchCheck"></a> |
|
417 <h4>CodeStyleCheckerPlugin.styleBatchCheck</h4> |
|
418 <b>styleBatchCheck</b>(<i>argumentsList</i>) |
|
419 |
|
420 <p> |
|
421 Public method to prepare a style check on multiple Python source files. |
|
422 </p> |
|
423 <dl> |
|
424 |
|
425 <dt><i>argumentsList</i> (list of tuple of (str, str, list))</dt> |
|
426 <dd> |
|
427 list of arguments tuples with each tuple |
|
428 containing filename, source and args as given in styleCheck() |
|
429 method |
|
430 </dd> |
|
431 </dl> |
|
432 <a NAME="CodeStyleCheckerPlugin.styleCheck" ID="CodeStyleCheckerPlugin.styleCheck"></a> |
|
433 <h4>CodeStyleCheckerPlugin.styleCheck</h4> |
|
434 <b>styleCheck</b>(<i>lang, filename, source, args</i>) |
|
435 |
|
436 <p> |
|
437 Public method to prepare a style check on one Python source file. |
|
438 </p> |
|
439 <dl> |
|
440 |
|
441 <dt><i>lang</i> (str or None)</dt> |
|
442 <dd> |
|
443 language of the file or None to determine by internal |
|
444 algorithm |
|
445 </dd> |
|
446 <dt><i>filename</i> (str)</dt> |
|
447 <dd> |
|
448 source filename |
|
449 </dd> |
|
450 <dt><i>source</i> (str)</dt> |
|
451 <dd> |
|
452 string containing the code to check |
|
453 </dd> |
|
454 <dt><i>args</i> (list of (str, str, bool, str, str, bool, int, list of (int, int),)</dt> |
|
455 <dd> |
|
456 arguments used by the codeStyleCheck function (list of |
|
457 excludeMessages, includeMessages, repeatMessages, fixCodes, |
|
458 noFixCodes, fixIssues, maxLineLength, blankLines, hangClosing, |
|
459 docType, codeComplexityArgs, miscellaneousArgs, errors, eol, |
|
460 encoding, backup) |
|
461 bool, str, dict, dict, list of str, str, str, bool) |
|
462 </dd> |
|
463 </dl> |
|
464 <div align="right"><a href="#top">Up</a></div> |
|
465 <hr /> |
|
466 </body></html> |