src/eric7/Documentation/Source/eric7.Plugins.PluginCodeStyleChecker.html

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

eric ide

mercurial