28 <tr><td>None</td></tr> |
28 <tr><td>None</td></tr> |
29 </table> |
29 </table> |
30 <h3>Classes</h3> |
30 <h3>Classes</h3> |
31 <table> |
31 <table> |
32 <tr> |
32 <tr> |
33 <td><a href="#CodeStyleCheckerPy2">CodeStyleCheckerPy2</a></td> |
33 <td><a href="#CodeStyleCheckerReport">CodeStyleCheckerReport</a></td> |
34 <td>Class implementing the code style checker interface for Python 2.</td> |
34 <td>Class implementing a special report to be used with our dialog.</td> |
35 </tr> |
35 </tr> |
36 </table> |
36 </table> |
37 <h3>Functions</h3> |
37 <h3>Functions</h3> |
38 <table> |
38 <table> |
39 <tr><td>None</td></tr> |
39 <tr> |
|
40 <td><a href="#codeStyleCheck">codeStyleCheck</a></td> |
|
41 <td>Do the code style check and/ or fix found errors.</td> |
|
42 </tr><tr> |
|
43 <td><a href="#extractLineFlags">extractLineFlags</a></td> |
|
44 <td>Function to extract flags starting and ending with '__' from a line comment.</td> |
|
45 </tr><tr> |
|
46 <td><a href="#initService">initService</a></td> |
|
47 <td>Initialize the service and return the entry point.</td> |
|
48 </tr> |
40 </table> |
49 </table> |
41 <hr /><hr /> |
50 <hr /><hr /> |
42 <a NAME="CodeStyleCheckerPy2" ID="CodeStyleCheckerPy2"></a> |
51 <a NAME="CodeStyleCheckerReport" ID="CodeStyleCheckerReport"></a> |
43 <h2>CodeStyleCheckerPy2</h2> |
52 <h2>CodeStyleCheckerReport</h2> |
44 <p> |
53 <p> |
45 Class implementing the code style checker interface for Python 2. |
54 Class implementing a special report to be used with our dialog. |
46 </p> |
55 </p> |
47 <h3>Derived from</h3> |
56 <h3>Derived from</h3> |
48 object |
57 pep8.BaseReport |
49 <h3>Class Attributes</h3> |
58 <h3>Class Attributes</h3> |
50 <table> |
59 <table> |
51 <tr><td>None</td></tr> |
60 <tr><td>None</td></tr> |
52 </table> |
61 </table> |
53 <h3>Class Methods</h3> |
62 <h3>Class Methods</h3> |
55 <tr><td>None</td></tr> |
64 <tr><td>None</td></tr> |
56 </table> |
65 </table> |
57 <h3>Methods</h3> |
66 <h3>Methods</h3> |
58 <table> |
67 <table> |
59 <tr> |
68 <tr> |
60 <td><a href="#CodeStyleCheckerPy2.__init__">CodeStyleCheckerPy2</a></td> |
69 <td><a href="#CodeStyleCheckerReport.__init__">CodeStyleCheckerReport</a></td> |
61 <td>Constructor</td> |
70 <td>Constructor</td> |
|
71 </tr><tr> |
|
72 <td><a href="#CodeStyleCheckerReport.error_args">error_args</a></td> |
|
73 <td>Public method to collect the error messages.</td> |
62 </tr> |
74 </tr> |
63 </table> |
75 </table> |
64 <h3>Static Methods</h3> |
76 <h3>Static Methods</h3> |
65 <table> |
77 <table> |
66 <tr><td>None</td></tr> |
78 <tr><td>None</td></tr> |
67 </table> |
79 </table> |
68 <a NAME="CodeStyleCheckerPy2.__init__" ID="CodeStyleCheckerPy2.__init__"></a> |
80 <a NAME="CodeStyleCheckerReport.__init__" ID="CodeStyleCheckerReport.__init__"></a> |
69 <h4>CodeStyleCheckerPy2 (Constructor)</h4> |
81 <h4>CodeStyleCheckerReport (Constructor)</h4> |
70 <b>CodeStyleCheckerPy2</b>(<i>filename, lines, repeat=False, select="", ignore="", max_line_length=79, hang_closing=False, docType="pep257"</i>) |
82 <b>CodeStyleCheckerReport</b>(<i>options</i>) |
71 <p> |
83 <p> |
72 Constructor |
84 Constructor |
73 </p><dl> |
85 </p><dl> |
|
86 <dt><i>options</i></dt> |
|
87 <dd> |
|
88 options for the report (optparse.Values) |
|
89 </dd> |
|
90 </dl><a NAME="CodeStyleCheckerReport.error_args" ID="CodeStyleCheckerReport.error_args"></a> |
|
91 <h4>CodeStyleCheckerReport.error_args</h4> |
|
92 <b>error_args</b>(<i>line_number, offset, code, check, *args</i>) |
|
93 <p> |
|
94 Public method to collect the error messages. |
|
95 </p><dl> |
|
96 <dt><i>line_number</i></dt> |
|
97 <dd> |
|
98 line number of the issue (integer) |
|
99 </dd><dt><i>offset</i></dt> |
|
100 <dd> |
|
101 position within line of the issue (integer) |
|
102 </dd><dt><i>code</i></dt> |
|
103 <dd> |
|
104 message code (string) |
|
105 </dd><dt><i>check</i></dt> |
|
106 <dd> |
|
107 reference to the checker function (function) |
|
108 </dd><dt><i>args</i></dt> |
|
109 <dd> |
|
110 arguments for the message (list) |
|
111 </dd> |
|
112 </dl><dl> |
|
113 <dt>Returns:</dt> |
|
114 <dd> |
|
115 error code (string) |
|
116 </dd> |
|
117 </dl> |
|
118 <div align="right"><a href="#top">Up</a></div> |
|
119 <hr /><hr /> |
|
120 <a NAME="codeStyleCheck" ID="codeStyleCheck"></a> |
|
121 <h2>codeStyleCheck</h2> |
|
122 <b>codeStyleCheck</b>(<i>filename, source, args</i>) |
|
123 <p> |
|
124 Do the code style check and/ or fix found errors. |
|
125 </p><dl> |
74 <dt><i>filename</i></dt> |
126 <dt><i>filename</i></dt> |
75 <dd> |
127 <dd> |
76 name of the file to check (string) |
128 source filename (string) |
77 </dd><dt><i>lines</i></dt> |
129 </dd><dt><i>source</i></dt> |
78 <dd> |
130 <dd> |
79 source of the file (list of strings) (ignored) |
131 string containing the code to check (string) |
80 </dd><dt><i>repeat=</i></dt> |
132 </dd><dt><i>args</i></dt> |
81 <dd> |
133 <dd> |
82 flag indicating to repeat message categories (boolean) |
134 arguments used by the codeStyleCheck function (list of |
83 </dd><dt><i>select=</i></dt> |
135 excludeMessages (str), includeMessages (str), repeatMessages |
84 <dd> |
136 (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), |
85 list of message IDs to check for |
137 maxLineLength (int), hangClosing (bool), docType (str), errors |
86 (comma separated string) |
138 (list of str), eol (str), encoding (str)) |
87 </dd><dt><i>ignore=</i></dt> |
|
88 <dd> |
|
89 list of message IDs to ignore |
|
90 (comma separated string) |
|
91 </dd><dt><i>max_line_length=</i></dt> |
|
92 <dd> |
|
93 maximum allowed line length (integer) |
|
94 </dd><dt><i>hang_closing=</i></dt> |
|
95 <dd> |
|
96 flag indicating to allow hanging closing |
|
97 brackets (boolean) |
|
98 </dd><dt><i>docType=</i></dt> |
|
99 <dd> |
|
100 type of the documentation strings |
|
101 (string, one of 'eric' or 'pep257') |
|
102 </dd> |
139 </dd> |
103 </dl><dl> |
140 </dl><dl> |
104 <dt>Raises <b>AssertionError</b>:</dt> |
141 <dt>Returns:</dt> |
105 <dd> |
142 <dd> |
106 raised if the docType argument is not |
143 tuple of stats (dict) and results (tuple for each found violation |
107 "eric" or "pep257" |
144 of style (tuple of lineno (int), position (int), text (str), fixed |
|
145 (bool), autofixing (bool), fixedMsg (str))) |
|
146 </dd> |
|
147 </dl> |
|
148 <div align="right"><a href="#top">Up</a></div> |
|
149 <hr /><hr /> |
|
150 <a NAME="extractLineFlags" ID="extractLineFlags"></a> |
|
151 <h2>extractLineFlags</h2> |
|
152 <b>extractLineFlags</b>(<i>line, startComment="</i>) |
|
153 <p> |
|
154 Function to extract flags starting and ending with '__' from a line |
|
155 comment. |
|
156 </p><dl> |
|
157 <dt><i>line</i></dt> |
|
158 <dd> |
|
159 line to extract flags from (string) |
|
160 </dd><dt><i>startComment=</i></dt> |
|
161 <dd> |
|
162 string identifying the start of the comment (string) |
|
163 </dd><dt><i>endComment=</i></dt> |
|
164 <dd> |
|
165 string identifying the end of a comment (string) |
|
166 </dd> |
|
167 </dl><dl> |
|
168 <dt>Returns:</dt> |
|
169 <dd> |
|
170 list containing the extracted flags (list of strings) |
|
171 </dd> |
|
172 </dl> |
|
173 <div align="right"><a href="#top">Up</a></div> |
|
174 <hr /><hr /> |
|
175 <a NAME="initService" ID="initService"></a> |
|
176 <h2>initService</h2> |
|
177 <b>initService</b>(<i></i>) |
|
178 <p> |
|
179 Initialize the service and return the entry point. |
|
180 </p><dl> |
|
181 <dt>Returns:</dt> |
|
182 <dd> |
|
183 the entry point for the background client (function) |
108 </dd> |
184 </dd> |
109 </dl> |
185 </dl> |
110 <div align="right"><a href="#top">Up</a></div> |
186 <div align="right"><a href="#top">Up</a></div> |
111 <hr /> |
187 <hr /> |
112 </body></html> |
188 </body></html> |