|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Async.AsyncChecker</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.Async.AsyncChecker</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a checker for "async" related issues. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#AsyncChecker">AsyncChecker</a></td> |
|
25 <td>Class implementing a checker for "async" related issues.</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="AsyncChecker" ID="AsyncChecker"></a> |
|
36 <h2>AsyncChecker</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing a checker for "async" related issues. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 None |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>Codes</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#AsyncChecker.__init__">AsyncChecker</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#AsyncChecker.__checkSyncUses">__checkSyncUses</a></td> |
|
63 <td>Private method to check for use of synchroneous functions in async methods.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#AsyncChecker.__error">__error</a></td> |
|
67 <td>Private method to record an issue.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#AsyncChecker.__ignoreCode">__ignoreCode</a></td> |
|
71 <td>Private method to check if the message code should be ignored.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#AsyncChecker.run">run</a></td> |
|
75 <td>Public method to check the given source against miscellaneous conditions.</td> |
|
76 </tr> |
|
77 </table> |
|
78 <h3>Static Methods</h3> |
|
79 |
|
80 <table> |
|
81 <tr><td>None</td></tr> |
|
82 </table> |
|
83 |
|
84 <a NAME="AsyncChecker.__init__" ID="AsyncChecker.__init__"></a> |
|
85 <h4>AsyncChecker (Constructor)</h4> |
|
86 <b>AsyncChecker</b>(<i>source, filename, tree, select, ignore, expected, repeat, args</i>) |
|
87 |
|
88 <p> |
|
89 Constructor |
|
90 </p> |
|
91 <dl> |
|
92 |
|
93 <dt><i>source</i> (list of str)</dt> |
|
94 <dd> |
|
95 source code to be checked |
|
96 </dd> |
|
97 <dt><i>filename</i> (str)</dt> |
|
98 <dd> |
|
99 name of the source file |
|
100 </dd> |
|
101 <dt><i>tree</i> (ast.Module)</dt> |
|
102 <dd> |
|
103 AST tree of the source code |
|
104 </dd> |
|
105 <dt><i>select</i> (list of str)</dt> |
|
106 <dd> |
|
107 list of selected codes |
|
108 </dd> |
|
109 <dt><i>ignore</i> (list of str)</dt> |
|
110 <dd> |
|
111 list of codes to be ignored |
|
112 </dd> |
|
113 <dt><i>expected</i> (list of str)</dt> |
|
114 <dd> |
|
115 list of expected codes |
|
116 </dd> |
|
117 <dt><i>repeat</i> (bool)</dt> |
|
118 <dd> |
|
119 flag indicating to report each occurrence of a code |
|
120 </dd> |
|
121 <dt><i>args</i> (dict)</dt> |
|
122 <dd> |
|
123 dictionary of arguments for the various checks |
|
124 </dd> |
|
125 </dl> |
|
126 <a NAME="AsyncChecker.__checkSyncUses" ID="AsyncChecker.__checkSyncUses"></a> |
|
127 <h4>AsyncChecker.__checkSyncUses</h4> |
|
128 <b>__checkSyncUses</b>(<i></i>) |
|
129 |
|
130 <p> |
|
131 Private method to check for use of synchroneous functions in async methods. |
|
132 </p> |
|
133 <a NAME="AsyncChecker.__error" ID="AsyncChecker.__error"></a> |
|
134 <h4>AsyncChecker.__error</h4> |
|
135 <b>__error</b>(<i>lineNumber, offset, code, *args</i>) |
|
136 |
|
137 <p> |
|
138 Private method to record an issue. |
|
139 </p> |
|
140 <dl> |
|
141 |
|
142 <dt><i>lineNumber</i> (int)</dt> |
|
143 <dd> |
|
144 line number of the issue |
|
145 </dd> |
|
146 <dt><i>offset</i> (int)</dt> |
|
147 <dd> |
|
148 position within line of the issue |
|
149 </dd> |
|
150 <dt><i>code</i> (str)</dt> |
|
151 <dd> |
|
152 message code |
|
153 </dd> |
|
154 <dt><i>args</i> (list)</dt> |
|
155 <dd> |
|
156 arguments for the message |
|
157 </dd> |
|
158 </dl> |
|
159 <a NAME="AsyncChecker.__ignoreCode" ID="AsyncChecker.__ignoreCode"></a> |
|
160 <h4>AsyncChecker.__ignoreCode</h4> |
|
161 <b>__ignoreCode</b>(<i>code</i>) |
|
162 |
|
163 <p> |
|
164 Private method to check if the message code should be ignored. |
|
165 </p> |
|
166 <dl> |
|
167 |
|
168 <dt><i>code</i> (str)</dt> |
|
169 <dd> |
|
170 message code to check for |
|
171 </dd> |
|
172 </dl> |
|
173 <dl> |
|
174 <dt>Return:</dt> |
|
175 <dd> |
|
176 flag indicating to ignore the given code |
|
177 </dd> |
|
178 </dl> |
|
179 <dl> |
|
180 <dt>Return Type:</dt> |
|
181 <dd> |
|
182 bool |
|
183 </dd> |
|
184 </dl> |
|
185 <a NAME="AsyncChecker.run" ID="AsyncChecker.run"></a> |
|
186 <h4>AsyncChecker.run</h4> |
|
187 <b>run</b>(<i></i>) |
|
188 |
|
189 <p> |
|
190 Public method to check the given source against miscellaneous |
|
191 conditions. |
|
192 </p> |
|
193 <div align="right"><a href="#top">Up</a></div> |
|
194 <hr /> |
|
195 </body></html> |