eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.AnnotationsChecker.html

changeset 7247
bf9379f964f3
parent 7246
c32a350d2414
child 7273
391d6b7b1eff
equal deleted inserted replaced
7246:c32a350d2414 7247:bf9379f964f3
37 <td>Class implementing a node visitor to check function annotations.</td> 37 <td>Class implementing a node visitor to check function annotations.</td>
38 </tr> 38 </tr>
39 </table> 39 </table>
40 <h3>Functions</h3> 40 <h3>Functions</h3>
41 <table> 41 <table>
42 <tr><td>None</td></tr> 42 <tr>
43 <td><a href="#getAnnotationComplexity">getAnnotationComplexity</a></td>
44 <td>Function to determine the annotation complexity.</td>
45 </tr><tr>
46 <td><a href="#hasTypeAnnotations">hasTypeAnnotations</a></td>
47 <td>Function to check for type annotations.</td>
48 </tr>
43 </table> 49 </table>
44 <hr /><hr /> 50 <hr /><hr />
45 <a NAME="AnnotationsChecker" ID="AnnotationsChecker"></a> 51 <a NAME="AnnotationsChecker" ID="AnnotationsChecker"></a>
46 <h2>AnnotationsChecker</h2> 52 <h2>AnnotationsChecker</h2>
47 <p> 53 <p>
61 <table> 67 <table>
62 <tr> 68 <tr>
63 <td><a href="#AnnotationsChecker.__init__">AnnotationsChecker</a></td> 69 <td><a href="#AnnotationsChecker.__init__">AnnotationsChecker</a></td>
64 <td>Constructor</td> 70 <td>Constructor</td>
65 </tr><tr> 71 </tr><tr>
72 <td><a href="#AnnotationsChecker.__checkAnnotationComplexity">__checkAnnotationComplexity</a></td>
73 <td>Private method to check the type annotation complexity.</td>
74 </tr><tr>
75 <td><a href="#AnnotationsChecker.__checkAnnotationsCoverage">__checkAnnotationsCoverage</a></td>
76 <td>Private method to check for function annotation coverage.</td>
77 </tr><tr>
66 <td><a href="#AnnotationsChecker.__checkFunctionAnnotations">__checkFunctionAnnotations</a></td> 78 <td><a href="#AnnotationsChecker.__checkFunctionAnnotations">__checkFunctionAnnotations</a></td>
67 <td>Private method to check for function annotation issues.</td> 79 <td>Private method to check for function annotation issues.</td>
68 </tr><tr> 80 </tr><tr>
69 <td><a href="#AnnotationsChecker.__error">__error</a></td> 81 <td><a href="#AnnotationsChecker.__error">__error</a></td>
70 <td>Private method to record an issue.</td> 82 <td>Private method to record an issue.</td>
86 <table> 98 <table>
87 <tr><td>None</td></tr> 99 <tr><td>None</td></tr>
88 </table> 100 </table>
89 <a NAME="AnnotationsChecker.__init__" ID="AnnotationsChecker.__init__"></a> 101 <a NAME="AnnotationsChecker.__init__" ID="AnnotationsChecker.__init__"></a>
90 <h4>AnnotationsChecker (Constructor)</h4> 102 <h4>AnnotationsChecker (Constructor)</h4>
91 <b>AnnotationsChecker</b>(<i>source, filename, select, ignore, expected, repeat</i>) 103 <b>AnnotationsChecker</b>(<i>source, filename, select, ignore, expected, repeat, args</i>)
92 <p> 104 <p>
93 Constructor 105 Constructor
94 </p><dl> 106 </p><dl>
95 <dt><i>source</i> (list of str)</dt> 107 <dt><i>source</i> (list of str)</dt>
96 <dd> 108 <dd>
108 <dd> 120 <dd>
109 list of expected codes 121 list of expected codes
110 </dd><dt><i>repeat</i> (bool)</dt> 122 </dd><dt><i>repeat</i> (bool)</dt>
111 <dd> 123 <dd>
112 flag indicating to report each occurrence of a code 124 flag indicating to report each occurrence of a code
113 </dd> 125 </dd><dt><i>args</i> (dict)</dt>
114 </dl><a NAME="AnnotationsChecker.__checkFunctionAnnotations" ID="AnnotationsChecker.__checkFunctionAnnotations"></a> 126 <dd>
127 dictionary of arguments for the annotation checks
128 </dd>
129 </dl><a NAME="AnnotationsChecker.__checkAnnotationComplexity" ID="AnnotationsChecker.__checkAnnotationComplexity"></a>
130 <h4>AnnotationsChecker.__checkAnnotationComplexity</h4>
131 <b>__checkAnnotationComplexity</b>(<i></i>)
132 <p>
133 Private method to check the type annotation complexity.
134 </p><a NAME="AnnotationsChecker.__checkAnnotationsCoverage" ID="AnnotationsChecker.__checkAnnotationsCoverage"></a>
135 <h4>AnnotationsChecker.__checkAnnotationsCoverage</h4>
136 <b>__checkAnnotationsCoverage</b>(<i></i>)
137 <p>
138 Private method to check for function annotation coverage.
139 </p><a NAME="AnnotationsChecker.__checkFunctionAnnotations" ID="AnnotationsChecker.__checkFunctionAnnotations"></a>
115 <h4>AnnotationsChecker.__checkFunctionAnnotations</h4> 140 <h4>AnnotationsChecker.__checkFunctionAnnotations</h4>
116 <b>__checkFunctionAnnotations</b>(<i></i>) 141 <b>__checkFunctionAnnotations</b>(<i></i>)
117 <p> 142 <p>
118 Private method to check for function annotation issues. 143 Private method to check for function annotation issues.
119 </p><a NAME="AnnotationsChecker.__error" ID="AnnotationsChecker.__error"></a> 144 </p><a NAME="AnnotationsChecker.__error" ID="AnnotationsChecker.__error"></a>
317 <dd> 342 <dd>
318 reference to the node to be processed 343 reference to the node to be processed
319 </dd> 344 </dd>
320 </dl> 345 </dl>
321 <div align="right"><a href="#top">Up</a></div> 346 <div align="right"><a href="#top">Up</a></div>
347 <hr /><hr />
348 <a NAME="getAnnotationComplexity" ID="getAnnotationComplexity"></a>
349 <h2>getAnnotationComplexity</h2>
350 <b>getAnnotationComplexity</b>(<i>annotationNode</i>)
351 <p>
352 Function to determine the annotation complexity.
353 </p><dl>
354 <dt><i>annotationNode</i> (ast.AST)</dt>
355 <dd>
356 reference to the node to determine the annotation
357 complexity for
358 </dd>
359 </dl><dl>
360 <dt>Returns:</dt>
361 <dd>
362 annotation complexity
363 </dd>
364 </dl><dl>
365 <dt>Return Type:</dt>
366 <dd>
367 = int
368 </dd>
369 </dl>
370 <div align="right"><a href="#top">Up</a></div>
371 <hr /><hr />
372 <a NAME="hasTypeAnnotations" ID="hasTypeAnnotations"></a>
373 <h2>hasTypeAnnotations</h2>
374 <b>hasTypeAnnotations</b>(<i>funcNode</i>)
375 <p>
376 Function to check for type annotations.
377 </p><dl>
378 <dt><i>funcNode</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt>
379 <dd>
380 reference to the function definition node to be checked
381 </dd>
382 </dl><dl>
383 <dt>Returns:</dt>
384 <dd>
385 flag indicating the presence of type annotations
386 </dd>
387 </dl><dl>
388 <dt>Return Type:</dt>
389 <dd>
390 bool
391 </dd>
392 </dl>
393 <div align="right"><a href="#top">Up</a></div>
322 <hr /> 394 <hr />
323 </body></html> 395 </body></html>

eric ide

mercurial