eric6/Documentation/Source/eric6.Plugins.PluginCodeStyleChecker.html

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

eric ide

mercurial