|
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>styleChecked(str, dict, int, list)</dt> |
|
49 <dd> |
|
50 emited when the style check was |
|
51 done. |
|
52 </dd> |
|
53 </dl> |
|
54 <h3>Derived from</h3> |
|
55 QObject |
|
56 <h3>Class Attributes</h3> |
|
57 <table> |
|
58 <tr><td>None</td></tr> |
|
59 </table> |
|
60 <h3>Class Methods</h3> |
|
61 <table> |
|
62 <tr><td>None</td></tr> |
|
63 </table> |
|
64 <h3>Methods</h3> |
|
65 <table> |
|
66 <tr> |
|
67 <td><a href="#CodeStyleCheckerPlugin.__init__">CodeStyleCheckerPlugin</a></td> |
|
68 <td>Constructor</td> |
|
69 </tr><tr> |
|
70 <td><a href="#CodeStyleCheckerPlugin.__editorClosed">__editorClosed</a></td> |
|
71 <td>Private slot called, when an editor was closed.</td> |
|
72 </tr><tr> |
|
73 <td><a href="#CodeStyleCheckerPlugin.__editorCodeStyleCheck">__editorCodeStyleCheck</a></td> |
|
74 <td>Private slot to handle the code style check context menu action of the editors.</td> |
|
75 </tr><tr> |
|
76 <td><a href="#CodeStyleCheckerPlugin.__editorOpened">__editorOpened</a></td> |
|
77 <td>Private slot called, when a new editor was opened.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#CodeStyleCheckerPlugin.__editorShowMenu">__editorShowMenu</a></td> |
|
80 <td>Private slot called, when the the editor context menu or a submenu is about to be shown.</td> |
|
81 </tr><tr> |
|
82 <td><a href="#CodeStyleCheckerPlugin.__initialize">__initialize</a></td> |
|
83 <td>Private slot to (re)initialize the plugin.</td> |
|
84 </tr><tr> |
|
85 <td><a href="#CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck">__projectBrowserCodeStyleCheck</a></td> |
|
86 <td>Private method to handle the code style check context menu action of the project sources browser.</td> |
|
87 </tr><tr> |
|
88 <td><a href="#CodeStyleCheckerPlugin.__projectBrowserShowMenu">__projectBrowserShowMenu</a></td> |
|
89 <td>Private slot called, when the the project browser menu or a submenu is about to be shown.</td> |
|
90 </tr><tr> |
|
91 <td><a href="#CodeStyleCheckerPlugin.__projectCodeStyleCheck">__projectCodeStyleCheck</a></td> |
|
92 <td>Private slot used to check the project files for code style.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#CodeStyleCheckerPlugin.__projectShowMenu">__projectShowMenu</a></td> |
|
95 <td>Private slot called, when the the project menu or a submenu is about to be shown.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#CodeStyleCheckerPlugin.__serviceError">__serviceError</a></td> |
|
98 <td>Private slot handling service errors.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#CodeStyleCheckerPlugin.__translateStyleCheck">__translateStyleCheck</a></td> |
|
101 <td>Private slot called after perfoming a style check on one file.</td> |
|
102 </tr><tr> |
|
103 <td><a href="#CodeStyleCheckerPlugin.activate">activate</a></td> |
|
104 <td>Public method to activate this plugin.</td> |
|
105 </tr><tr> |
|
106 <td><a href="#CodeStyleCheckerPlugin.deactivate">deactivate</a></td> |
|
107 <td>Public method to deactivate this plugin.</td> |
|
108 </tr><tr> |
|
109 <td><a href="#CodeStyleCheckerPlugin.serviceErrorPy2">serviceErrorPy2</a></td> |
|
110 <td>Public method handling service errors for Python 2.</td> |
|
111 </tr><tr> |
|
112 <td><a href="#CodeStyleCheckerPlugin.serviceErrorPy3">serviceErrorPy3</a></td> |
|
113 <td>Public method handling service errors for Python 2.</td> |
|
114 </tr><tr> |
|
115 <td><a href="#CodeStyleCheckerPlugin.styleCheck">styleCheck</a></td> |
|
116 <td>Public method to prepare a style check on one Python source file.</td> |
|
117 </tr> |
|
118 </table> |
|
119 <h3>Static Methods</h3> |
|
120 <table> |
|
121 <tr><td>None</td></tr> |
|
122 </table> |
|
123 <a NAME="CodeStyleCheckerPlugin.__init__" ID="CodeStyleCheckerPlugin.__init__"></a> |
|
124 <h4>CodeStyleCheckerPlugin (Constructor)</h4> |
|
125 <b>CodeStyleCheckerPlugin</b>(<i>ui</i>) |
|
126 <p> |
|
127 Constructor |
|
128 </p><dl> |
|
129 <dt><i>ui</i></dt> |
|
130 <dd> |
|
131 reference to the user interface object (UI.UserInterface) |
|
132 </dd> |
|
133 </dl><a NAME="CodeStyleCheckerPlugin.__editorClosed" ID="CodeStyleCheckerPlugin.__editorClosed"></a> |
|
134 <h4>CodeStyleCheckerPlugin.__editorClosed</h4> |
|
135 <b>__editorClosed</b>(<i>editor</i>) |
|
136 <p> |
|
137 Private slot called, when an editor was closed. |
|
138 </p><dl> |
|
139 <dt><i>editor</i></dt> |
|
140 <dd> |
|
141 reference to the editor (QScintilla.Editor) |
|
142 </dd> |
|
143 </dl><a NAME="CodeStyleCheckerPlugin.__editorCodeStyleCheck" ID="CodeStyleCheckerPlugin.__editorCodeStyleCheck"></a> |
|
144 <h4>CodeStyleCheckerPlugin.__editorCodeStyleCheck</h4> |
|
145 <b>__editorCodeStyleCheck</b>(<i></i>) |
|
146 <p> |
|
147 Private slot to handle the code style check context menu action |
|
148 of the editors. |
|
149 </p><a NAME="CodeStyleCheckerPlugin.__editorOpened" ID="CodeStyleCheckerPlugin.__editorOpened"></a> |
|
150 <h4>CodeStyleCheckerPlugin.__editorOpened</h4> |
|
151 <b>__editorOpened</b>(<i>editor</i>) |
|
152 <p> |
|
153 Private slot called, when a new editor was opened. |
|
154 </p><dl> |
|
155 <dt><i>editor</i></dt> |
|
156 <dd> |
|
157 reference to the new editor (QScintilla.Editor) |
|
158 </dd> |
|
159 </dl><a NAME="CodeStyleCheckerPlugin.__editorShowMenu" ID="CodeStyleCheckerPlugin.__editorShowMenu"></a> |
|
160 <h4>CodeStyleCheckerPlugin.__editorShowMenu</h4> |
|
161 <b>__editorShowMenu</b>(<i>menuName, menu, editor</i>) |
|
162 <p> |
|
163 Private slot called, when the the editor context menu or a submenu is |
|
164 about to be shown. |
|
165 </p><dl> |
|
166 <dt><i>menuName</i></dt> |
|
167 <dd> |
|
168 name of the menu to be shown (string) |
|
169 </dd><dt><i>menu</i></dt> |
|
170 <dd> |
|
171 reference to the menu (QMenu) |
|
172 </dd><dt><i>editor</i></dt> |
|
173 <dd> |
|
174 reference to the editor |
|
175 </dd> |
|
176 </dl><a NAME="CodeStyleCheckerPlugin.__initialize" ID="CodeStyleCheckerPlugin.__initialize"></a> |
|
177 <h4>CodeStyleCheckerPlugin.__initialize</h4> |
|
178 <b>__initialize</b>(<i></i>) |
|
179 <p> |
|
180 Private slot to (re)initialize the plugin. |
|
181 </p><a NAME="CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck" ID="CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck"></a> |
|
182 <h4>CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck</h4> |
|
183 <b>__projectBrowserCodeStyleCheck</b>(<i></i>) |
|
184 <p> |
|
185 Private method to handle the code style check context menu action of |
|
186 the project sources browser. |
|
187 </p><a NAME="CodeStyleCheckerPlugin.__projectBrowserShowMenu" ID="CodeStyleCheckerPlugin.__projectBrowserShowMenu"></a> |
|
188 <h4>CodeStyleCheckerPlugin.__projectBrowserShowMenu</h4> |
|
189 <b>__projectBrowserShowMenu</b>(<i>menuName, menu</i>) |
|
190 <p> |
|
191 Private slot called, when the the project browser menu or a submenu is |
|
192 about to be shown. |
|
193 </p><dl> |
|
194 <dt><i>menuName</i></dt> |
|
195 <dd> |
|
196 name of the menu to be shown (string) |
|
197 </dd><dt><i>menu</i></dt> |
|
198 <dd> |
|
199 reference to the menu (QMenu) |
|
200 </dd> |
|
201 </dl><a NAME="CodeStyleCheckerPlugin.__projectCodeStyleCheck" ID="CodeStyleCheckerPlugin.__projectCodeStyleCheck"></a> |
|
202 <h4>CodeStyleCheckerPlugin.__projectCodeStyleCheck</h4> |
|
203 <b>__projectCodeStyleCheck</b>(<i></i>) |
|
204 <p> |
|
205 Private slot used to check the project files for code style. |
|
206 </p><a NAME="CodeStyleCheckerPlugin.__projectShowMenu" ID="CodeStyleCheckerPlugin.__projectShowMenu"></a> |
|
207 <h4>CodeStyleCheckerPlugin.__projectShowMenu</h4> |
|
208 <b>__projectShowMenu</b>(<i>menuName, menu</i>) |
|
209 <p> |
|
210 Private slot called, when the the project menu or a submenu is |
|
211 about to be shown. |
|
212 </p><dl> |
|
213 <dt><i>menuName</i></dt> |
|
214 <dd> |
|
215 name of the menu to be shown (string) |
|
216 </dd><dt><i>menu</i></dt> |
|
217 <dd> |
|
218 reference to the menu (QMenu) |
|
219 </dd> |
|
220 </dl><a NAME="CodeStyleCheckerPlugin.__serviceError" ID="CodeStyleCheckerPlugin.__serviceError"></a> |
|
221 <h4>CodeStyleCheckerPlugin.__serviceError</h4> |
|
222 <b>__serviceError</b>(<i>fn, msg</i>) |
|
223 <p> |
|
224 Private slot handling service errors. |
|
225 </p><dl> |
|
226 <dt><i>fn</i></dt> |
|
227 <dd> |
|
228 file name (string) |
|
229 </dd><dt><i>msg</i></dt> |
|
230 <dd> |
|
231 message text (string) |
|
232 </dd> |
|
233 </dl><a NAME="CodeStyleCheckerPlugin.__translateStyleCheck" ID="CodeStyleCheckerPlugin.__translateStyleCheck"></a> |
|
234 <h4>CodeStyleCheckerPlugin.__translateStyleCheck</h4> |
|
235 <b>__translateStyleCheck</b>(<i>fn, codeStyleCheckerStats, results</i>) |
|
236 <p> |
|
237 Private slot called after perfoming a style check on one file. |
|
238 </p><dl> |
|
239 <dt><i>fn</i></dt> |
|
240 <dd> |
|
241 filename of the just checked file (str) |
|
242 </dd><dt><i>codeStyleCheckerStats</i></dt> |
|
243 <dd> |
|
244 stats of style and name check (dict) |
|
245 </dd><dt><i>results</i></dt> |
|
246 <dd> |
|
247 tuple for each found violation of style (tuple of |
|
248 lineno (int), position (int), text (str), fixed (bool), |
|
249 autofixing (bool), fixedMsg (str)) |
|
250 </dd> |
|
251 </dl><a NAME="CodeStyleCheckerPlugin.activate" ID="CodeStyleCheckerPlugin.activate"></a> |
|
252 <h4>CodeStyleCheckerPlugin.activate</h4> |
|
253 <b>activate</b>(<i></i>) |
|
254 <p> |
|
255 Public method to activate this plugin. |
|
256 </p><dl> |
|
257 <dt>Returns:</dt> |
|
258 <dd> |
|
259 tuple of None and activation status (boolean) |
|
260 </dd> |
|
261 </dl><a NAME="CodeStyleCheckerPlugin.deactivate" ID="CodeStyleCheckerPlugin.deactivate"></a> |
|
262 <h4>CodeStyleCheckerPlugin.deactivate</h4> |
|
263 <b>deactivate</b>(<i></i>) |
|
264 <p> |
|
265 Public method to deactivate this plugin. |
|
266 </p><a NAME="CodeStyleCheckerPlugin.serviceErrorPy2" ID="CodeStyleCheckerPlugin.serviceErrorPy2"></a> |
|
267 <h4>CodeStyleCheckerPlugin.serviceErrorPy2</h4> |
|
268 <b>serviceErrorPy2</b>(<i>fx, lang, fn, msg</i>) |
|
269 <p> |
|
270 Public method handling service errors for Python 2. |
|
271 </p><dl> |
|
272 <dt><i>fx</i></dt> |
|
273 <dd> |
|
274 service name (string) |
|
275 </dd><dt><i>lang</i></dt> |
|
276 <dd> |
|
277 language (string) |
|
278 </dd><dt><i>fn</i></dt> |
|
279 <dd> |
|
280 file name (string) |
|
281 </dd><dt><i>msg</i></dt> |
|
282 <dd> |
|
283 message text (string) |
|
284 </dd> |
|
285 </dl><a NAME="CodeStyleCheckerPlugin.serviceErrorPy3" ID="CodeStyleCheckerPlugin.serviceErrorPy3"></a> |
|
286 <h4>CodeStyleCheckerPlugin.serviceErrorPy3</h4> |
|
287 <b>serviceErrorPy3</b>(<i>fx, lang, fn, msg</i>) |
|
288 <p> |
|
289 Public method handling service errors for Python 2. |
|
290 </p><dl> |
|
291 <dt><i>fx</i></dt> |
|
292 <dd> |
|
293 service name (string) |
|
294 </dd><dt><i>lang</i></dt> |
|
295 <dd> |
|
296 language (string) |
|
297 </dd><dt><i>fn</i></dt> |
|
298 <dd> |
|
299 file name (string) |
|
300 </dd><dt><i>msg</i></dt> |
|
301 <dd> |
|
302 message text (string) |
|
303 </dd> |
|
304 </dl><a NAME="CodeStyleCheckerPlugin.styleCheck" ID="CodeStyleCheckerPlugin.styleCheck"></a> |
|
305 <h4>CodeStyleCheckerPlugin.styleCheck</h4> |
|
306 <b>styleCheck</b>(<i>lang, filename, source, args</i>) |
|
307 <p> |
|
308 Public method to prepare a style check on one Python source file. |
|
309 </p><dl> |
|
310 <dt><i>lang</i></dt> |
|
311 <dd> |
|
312 language of the file or None to determine by internal |
|
313 algorithm (str or None) |
|
314 </dd><dt><i>filename</i></dt> |
|
315 <dd> |
|
316 source filename (string) |
|
317 </dd><dt><i>source</i></dt> |
|
318 <dd> |
|
319 string containing the code to check (string) |
|
320 </dd><dt><i>args</i></dt> |
|
321 <dd> |
|
322 arguments used by the codeStyleCheck function (list of |
|
323 excludeMessages (str), includeMessages (str), repeatMessages |
|
324 (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), |
|
325 maxLineLength (int), hangClosing (bool), docType (str), errors |
|
326 (list of str), eol (str), encoding (str)) |
|
327 </dd> |
|
328 </dl> |
|
329 <div align="right"><a href="#top">Up</a></div> |
|
330 <hr /> |
|
331 </body></html> |