|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleTopicChecker</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.CheckerPlugins.CodeStyleChecker.CodeStyleTopicChecker</h1> |
|
10 <p> |
|
11 Module implementing the topic checker base class containing common methods. |
|
12 </p> |
|
13 |
|
14 <h3>Global Attributes</h3> |
|
15 <table> |
|
16 <tr><td>None</td></tr> |
|
17 </table> |
|
18 |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#CodeStyleTopicChecker">CodeStyleTopicChecker</a></td> |
|
23 <td>Class implementing the topic checker base class.</td> |
|
24 </tr> |
|
25 </table> |
|
26 |
|
27 <h3>Functions</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 |
|
32 <hr /> |
|
33 <hr /> |
|
34 <a NAME="CodeStyleTopicChecker" ID="CodeStyleTopicChecker"></a> |
|
35 <h2>CodeStyleTopicChecker</h2> |
|
36 <p> |
|
37 Class implementing the topic checker base class. |
|
38 </p> |
|
39 |
|
40 <h3>Derived from</h3> |
|
41 None |
|
42 <h3>Class Attributes</h3> |
|
43 <table> |
|
44 <tr><td>None</td></tr> |
|
45 </table> |
|
46 |
|
47 <h3>Class Methods</h3> |
|
48 <table> |
|
49 <tr><td>None</td></tr> |
|
50 </table> |
|
51 |
|
52 <h3>Methods</h3> |
|
53 <table> |
|
54 <tr> |
|
55 <td><a href="#CodeStyleTopicChecker.__init__">CodeStyleTopicChecker</a></td> |
|
56 <td>Constructor</td> |
|
57 </tr> |
|
58 <tr> |
|
59 <td><a href="#CodeStyleTopicChecker._ignoreCode">_ignoreCode</a></td> |
|
60 <td>Protected method to check if the message code should be ignored.</td> |
|
61 </tr> |
|
62 <tr> |
|
63 <td><a href="#CodeStyleTopicChecker._initializeCheckers">_initializeCheckers</a></td> |
|
64 <td>Protected method to determine the list of check methods to be run.</td> |
|
65 </tr> |
|
66 <tr> |
|
67 <td><a href="#CodeStyleTopicChecker.addError">addError</a></td> |
|
68 <td>Public method to record an issue.</td> |
|
69 </tr> |
|
70 <tr> |
|
71 <td><a href="#CodeStyleTopicChecker.addErrorFromNode">addErrorFromNode</a></td> |
|
72 <td>Public method to record an issue given the faulty ast node.</td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td><a href="#CodeStyleTopicChecker.run">run</a></td> |
|
76 <td>Public method to execute the relevant checks.</td> |
|
77 </tr> |
|
78 </table> |
|
79 |
|
80 <h3>Static Methods</h3> |
|
81 <table> |
|
82 <tr><td>None</td></tr> |
|
83 </table> |
|
84 |
|
85 |
|
86 <a NAME="CodeStyleTopicChecker.__init__" ID="CodeStyleTopicChecker.__init__"></a> |
|
87 <h4>CodeStyleTopicChecker (Constructor)</h4> |
|
88 <b>CodeStyleTopicChecker</b>(<i>category, source, filename, tree, select, ignore, expected, repeat, args</i>) |
|
89 <p> |
|
90 Constructor |
|
91 </p> |
|
92 |
|
93 <dl> |
|
94 |
|
95 <dt><i>category</i> (str)</dt> |
|
96 <dd> |
|
97 checker category code (one to three uppercase characters |
|
98 </dd> |
|
99 <dt><i>source</i> (list of str)</dt> |
|
100 <dd> |
|
101 source code to be checked |
|
102 </dd> |
|
103 <dt><i>filename</i> (str)</dt> |
|
104 <dd> |
|
105 name of the source file |
|
106 </dd> |
|
107 <dt><i>tree</i> (ast.Module)</dt> |
|
108 <dd> |
|
109 AST tree of the source code |
|
110 </dd> |
|
111 <dt><i>select</i> (list of str)</dt> |
|
112 <dd> |
|
113 list of selected codes |
|
114 </dd> |
|
115 <dt><i>ignore</i> (list of str)</dt> |
|
116 <dd> |
|
117 list of codes to be ignored |
|
118 </dd> |
|
119 <dt><i>expected</i> (list of str)</dt> |
|
120 <dd> |
|
121 list of expected codes |
|
122 </dd> |
|
123 <dt><i>repeat</i> (bool)</dt> |
|
124 <dd> |
|
125 flag indicating to report each occurrence of a code |
|
126 </dd> |
|
127 <dt><i>args</i> (dict)</dt> |
|
128 <dd> |
|
129 dictionary of arguments for the various checks |
|
130 </dd> |
|
131 </dl> |
|
132 <a NAME="CodeStyleTopicChecker._ignoreCode" ID="CodeStyleTopicChecker._ignoreCode"></a> |
|
133 <h4>CodeStyleTopicChecker._ignoreCode</h4> |
|
134 <b>_ignoreCode</b>(<i>code</i>) |
|
135 <p> |
|
136 Protected method to check if the message code should be ignored. |
|
137 </p> |
|
138 |
|
139 <dl> |
|
140 |
|
141 <dt><i>code</i> (str)</dt> |
|
142 <dd> |
|
143 message code to check for |
|
144 </dd> |
|
145 </dl> |
|
146 <dl> |
|
147 <dt>Return:</dt> |
|
148 <dd> |
|
149 flag indicating to ignore the given code |
|
150 </dd> |
|
151 </dl> |
|
152 <dl> |
|
153 <dt>Return Type:</dt> |
|
154 <dd> |
|
155 bool |
|
156 </dd> |
|
157 </dl> |
|
158 <a NAME="CodeStyleTopicChecker._initializeCheckers" ID="CodeStyleTopicChecker._initializeCheckers"></a> |
|
159 <h4>CodeStyleTopicChecker._initializeCheckers</h4> |
|
160 <b>_initializeCheckers</b>(<i>checkersWithCodes</i>) |
|
161 <p> |
|
162 Protected method to determine the list of check methods to be run. |
|
163 </p> |
|
164 <p> |
|
165 This list is determined considering the list if selected and ignored issue |
|
166 codes. |
|
167 </p> |
|
168 |
|
169 <dl> |
|
170 |
|
171 <dt><i>checkersWithCodes</i> (TYPE)</dt> |
|
172 <dd> |
|
173 DESCRIPTION |
|
174 </dd> |
|
175 </dl> |
|
176 <a NAME="CodeStyleTopicChecker.addError" ID="CodeStyleTopicChecker.addError"></a> |
|
177 <h4>CodeStyleTopicChecker.addError</h4> |
|
178 <b>addError</b>(<i>lineNumber, offset, msgCode, *args</i>) |
|
179 <p> |
|
180 Public method to record an issue. |
|
181 </p> |
|
182 |
|
183 <dl> |
|
184 |
|
185 <dt><i>lineNumber</i> (int)</dt> |
|
186 <dd> |
|
187 line number of the issue (one based) |
|
188 </dd> |
|
189 <dt><i>offset</i> (int)</dt> |
|
190 <dd> |
|
191 position within line of the issue |
|
192 </dd> |
|
193 <dt><i>msgCode</i> (str)</dt> |
|
194 <dd> |
|
195 message code |
|
196 </dd> |
|
197 <dt><i>args</i> (list)</dt> |
|
198 <dd> |
|
199 arguments for the message |
|
200 </dd> |
|
201 </dl> |
|
202 <a NAME="CodeStyleTopicChecker.addErrorFromNode" ID="CodeStyleTopicChecker.addErrorFromNode"></a> |
|
203 <h4>CodeStyleTopicChecker.addErrorFromNode</h4> |
|
204 <b>addErrorFromNode</b>(<i>node, msgCode, *args</i>) |
|
205 <p> |
|
206 Public method to record an issue given the faulty ast node. |
|
207 </p> |
|
208 |
|
209 <dl> |
|
210 |
|
211 <dt><i>node</i> (ast.AST)</dt> |
|
212 <dd> |
|
213 reference to the node containing the issue |
|
214 </dd> |
|
215 <dt><i>msgCode</i> (str)</dt> |
|
216 <dd> |
|
217 message code |
|
218 </dd> |
|
219 <dt><i>args</i> (list)</dt> |
|
220 <dd> |
|
221 arguments for the message |
|
222 </dd> |
|
223 </dl> |
|
224 <a NAME="CodeStyleTopicChecker.run" ID="CodeStyleTopicChecker.run"></a> |
|
225 <h4>CodeStyleTopicChecker.run</h4> |
|
226 <b>run</b>(<i></i>) |
|
227 <p> |
|
228 Public method to execute the relevant checks. |
|
229 </p> |
|
230 |
|
231 <div align="right"><a href="#top">Up</a></div> |
|
232 <hr /> |
|
233 </body></html> |