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

changeset 7245
b47179fbb9d8
parent 7045
c2bf08f87a1d
child 7273
391d6b7b1eff
equal deleted inserted replaced
7244:3e6502e77117 7245:b47179fbb9d8
46 <td>Class to extract a name out of a tree of nodes.</td> 46 <td>Class to extract a name out of a tree of nodes.</td>
47 </tr><tr> 47 </tr><tr>
48 <td><a href="#ReturnVisitor">ReturnVisitor</a></td> 48 <td><a href="#ReturnVisitor">ReturnVisitor</a></td>
49 <td>Class implementing a node visitor to check return statements.</td> 49 <td>Class implementing a node visitor to check return statements.</td>
50 </tr><tr> 50 </tr><tr>
51 <td><a href="#SysVersionVisitor">SysVersionVisitor</a></td>
52 <td>Class implementing a node visitor to check the use of sys.version and sys.version_info.</td>
53 </tr><tr>
51 <td><a href="#TextVisitor">TextVisitor</a></td> 54 <td><a href="#TextVisitor">TextVisitor</a></td>
52 <td>Class implementing a node visitor for bytes and str instances.</td> 55 <td>Class implementing a node visitor for bytes and str instances.</td>
53 </tr> 56 </tr>
54 </table> 57 </table>
55 <h3>Functions</h3> 58 <h3>Functions</h3>
554 <td>Private method to check for print statements.</td> 557 <td>Private method to check for print statements.</td>
555 </tr><tr> 558 </tr><tr>
556 <td><a href="#MiscellaneousChecker.__checkReturn">__checkReturn</a></td> 559 <td><a href="#MiscellaneousChecker.__checkReturn">__checkReturn</a></td>
557 <td>Private method to check return statements.</td> 560 <td>Private method to check return statements.</td>
558 </tr><tr> 561 </tr><tr>
562 <td><a href="#MiscellaneousChecker.__checkSysVersion">__checkSysVersion</a></td>
563 <td>Private method to check the use of sys.version and sys.version_info.</td>
564 </tr><tr>
559 <td><a href="#MiscellaneousChecker.__checkTuple">__checkTuple</a></td> 565 <td><a href="#MiscellaneousChecker.__checkTuple">__checkTuple</a></td>
560 <td>Private method to check for one element tuples.</td> 566 <td>Private method to check for one element tuples.</td>
561 </tr><tr> 567 </tr><tr>
562 <td><a href="#MiscellaneousChecker.__dictShouldBeChecked">__dictShouldBeChecked</a></td> 568 <td><a href="#MiscellaneousChecker.__dictShouldBeChecked">__dictShouldBeChecked</a></td>
563 <td>Private function to test, if the node should be checked.</td> 569 <td>Private function to test, if the node should be checked.</td>
700 </p><a NAME="MiscellaneousChecker.__checkReturn" ID="MiscellaneousChecker.__checkReturn"></a> 706 </p><a NAME="MiscellaneousChecker.__checkReturn" ID="MiscellaneousChecker.__checkReturn"></a>
701 <h4>MiscellaneousChecker.__checkReturn</h4> 707 <h4>MiscellaneousChecker.__checkReturn</h4>
702 <b>__checkReturn</b>(<i></i>) 708 <b>__checkReturn</b>(<i></i>)
703 <p> 709 <p>
704 Private method to check return statements. 710 Private method to check return statements.
711 </p><a NAME="MiscellaneousChecker.__checkSysVersion" ID="MiscellaneousChecker.__checkSysVersion"></a>
712 <h4>MiscellaneousChecker.__checkSysVersion</h4>
713 <b>__checkSysVersion</b>(<i></i>)
714 <p>
715 Private method to check the use of sys.version and sys.version_info.
705 </p><a NAME="MiscellaneousChecker.__checkTuple" ID="MiscellaneousChecker.__checkTuple"></a> 716 </p><a NAME="MiscellaneousChecker.__checkTuple" ID="MiscellaneousChecker.__checkTuple"></a>
706 <h4>MiscellaneousChecker.__checkTuple</h4> 717 <h4>MiscellaneousChecker.__checkTuple</h4>
707 <b>__checkTuple</b>(<i></i>) 718 <b>__checkTuple</b>(<i></i>)
708 <p> 719 <p>
709 Private method to check for one element tuples. 720 Private method to check for one element tuples.
1203 Public method to handle a return node. 1214 Public method to handle a return node.
1204 </p><dl> 1215 </p><dl>
1205 <dt><i>node</i> (ast.Return)</dt> 1216 <dt><i>node</i> (ast.Return)</dt>
1206 <dd> 1217 <dd>
1207 reference to the node to handle 1218 reference to the node to handle
1219 </dd>
1220 </dl>
1221 <div align="right"><a href="#top">Up</a></div>
1222 <hr /><hr />
1223 <a NAME="SysVersionVisitor" ID="SysVersionVisitor"></a>
1224 <h2>SysVersionVisitor</h2>
1225 <p>
1226 Class implementing a node visitor to check the use of sys.version and
1227 sys.version_info.
1228 </p><p>
1229 Note: This class is modelled after flake8-2020 checker.
1230 </p>
1231 <h3>Derived from</h3>
1232 ast.NodeVisitor
1233 <h3>Class Attributes</h3>
1234 <table>
1235 <tr><td>None</td></tr>
1236 </table>
1237 <h3>Class Methods</h3>
1238 <table>
1239 <tr><td>None</td></tr>
1240 </table>
1241 <h3>Methods</h3>
1242 <table>
1243 <tr>
1244 <td><a href="#SysVersionVisitor.__init__">SysVersionVisitor</a></td>
1245 <td>Constructor</td>
1246 </tr><tr>
1247 <td><a href="#SysVersionVisitor.__isSys">__isSys</a></td>
1248 <td>Private method to check for a reference to sys attribute.</td>
1249 </tr><tr>
1250 <td><a href="#SysVersionVisitor.__isSysVersionUpperSlice">__isSysVersionUpperSlice</a></td>
1251 <td>Private method to check the upper slice of sys.version.</td>
1252 </tr><tr>
1253 <td><a href="#SysVersionVisitor.visit_Attribute">visit_Attribute</a></td>
1254 <td>Public method to handle an attribute.</td>
1255 </tr><tr>
1256 <td><a href="#SysVersionVisitor.visit_Compare">visit_Compare</a></td>
1257 <td>Public method to handle a comparison.</td>
1258 </tr><tr>
1259 <td><a href="#SysVersionVisitor.visit_ImportFrom">visit_ImportFrom</a></td>
1260 <td>Public method to handle a from ...</td>
1261 </tr><tr>
1262 <td><a href="#SysVersionVisitor.visit_Name">visit_Name</a></td>
1263 <td>Public method to handle an name.</td>
1264 </tr><tr>
1265 <td><a href="#SysVersionVisitor.visit_Subscript">visit_Subscript</a></td>
1266 <td>Public method to handle a subscript.</td>
1267 </tr>
1268 </table>
1269 <h3>Static Methods</h3>
1270 <table>
1271 <tr><td>None</td></tr>
1272 </table>
1273 <a NAME="SysVersionVisitor.__init__" ID="SysVersionVisitor.__init__"></a>
1274 <h4>SysVersionVisitor (Constructor)</h4>
1275 <b>SysVersionVisitor</b>(<i></i>)
1276 <p>
1277 Constructor
1278 </p><a NAME="SysVersionVisitor.__isSys" ID="SysVersionVisitor.__isSys"></a>
1279 <h4>SysVersionVisitor.__isSys</h4>
1280 <b>__isSys</b>(<i>attr, node</i>)
1281 <p>
1282 Private method to check for a reference to sys attribute.
1283 </p><dl>
1284 <dt><i>attr</i> (str)</dt>
1285 <dd>
1286 attribute name
1287 </dd><dt><i>node</i> (ast.Node)</dt>
1288 <dd>
1289 reference to the node to be checked
1290 </dd>
1291 </dl><dl>
1292 <dt>Returns:</dt>
1293 <dd>
1294 flag indicating a match
1295 </dd>
1296 </dl><dl>
1297 <dt>Return Type:</dt>
1298 <dd>
1299 bool
1300 </dd>
1301 </dl><a NAME="SysVersionVisitor.__isSysVersionUpperSlice" ID="SysVersionVisitor.__isSysVersionUpperSlice"></a>
1302 <h4>SysVersionVisitor.__isSysVersionUpperSlice</h4>
1303 <b>__isSysVersionUpperSlice</b>(<i>node, n</i>)
1304 <p>
1305 Private method to check the upper slice of sys.version.
1306 </p><dl>
1307 <dt><i>node</i> (ast.Node)</dt>
1308 <dd>
1309 reference to the node to be checked
1310 </dd><dt><i>n</i> (int)</dt>
1311 <dd>
1312 slice value to check against
1313 </dd>
1314 </dl><dl>
1315 <dt>Returns:</dt>
1316 <dd>
1317 flag indicating a match
1318 </dd>
1319 </dl><dl>
1320 <dt>Return Type:</dt>
1321 <dd>
1322 bool
1323 </dd>
1324 </dl><a NAME="SysVersionVisitor.visit_Attribute" ID="SysVersionVisitor.visit_Attribute"></a>
1325 <h4>SysVersionVisitor.visit_Attribute</h4>
1326 <b>visit_Attribute</b>(<i>node</i>)
1327 <p>
1328 Public method to handle an attribute.
1329 </p><dl>
1330 <dt><i>node</i> (ast.Attribute)</dt>
1331 <dd>
1332 reference to the node to be processed
1333 </dd>
1334 </dl><a NAME="SysVersionVisitor.visit_Compare" ID="SysVersionVisitor.visit_Compare"></a>
1335 <h4>SysVersionVisitor.visit_Compare</h4>
1336 <b>visit_Compare</b>(<i>node</i>)
1337 <p>
1338 Public method to handle a comparison.
1339 </p><dl>
1340 <dt><i>node</i> (ast.Compare)</dt>
1341 <dd>
1342 reference to the node to be processed
1343 </dd>
1344 </dl><a NAME="SysVersionVisitor.visit_ImportFrom" ID="SysVersionVisitor.visit_ImportFrom"></a>
1345 <h4>SysVersionVisitor.visit_ImportFrom</h4>
1346 <b>visit_ImportFrom</b>(<i>node</i>)
1347 <p>
1348 Public method to handle a from ... import ... statement.
1349 </p><dl>
1350 <dt><i>node</i> (ast.ImportFrom)</dt>
1351 <dd>
1352 reference to the node to be processed
1353 </dd>
1354 </dl><a NAME="SysVersionVisitor.visit_Name" ID="SysVersionVisitor.visit_Name"></a>
1355 <h4>SysVersionVisitor.visit_Name</h4>
1356 <b>visit_Name</b>(<i>node</i>)
1357 <p>
1358 Public method to handle an name.
1359 </p><dl>
1360 <dt><i>node</i> (ast.Name)</dt>
1361 <dd>
1362 reference to the node to be processed
1363 </dd>
1364 </dl><a NAME="SysVersionVisitor.visit_Subscript" ID="SysVersionVisitor.visit_Subscript"></a>
1365 <h4>SysVersionVisitor.visit_Subscript</h4>
1366 <b>visit_Subscript</b>(<i>node</i>)
1367 <p>
1368 Public method to handle a subscript.
1369 </p><dl>
1370 <dt><i>node</i> (ast.Subscript)</dt>
1371 <dd>
1372 reference to the node to be processed
1208 </dd> 1373 </dd>
1209 </dl> 1374 </dl>
1210 <div align="right"><a href="#top">Up</a></div> 1375 <div align="right"><a href="#top">Up</a></div>
1211 <hr /><hr /> 1376 <hr /><hr />
1212 <a NAME="TextVisitor" ID="TextVisitor"></a> 1377 <a NAME="TextVisitor" ID="TextVisitor"></a>

eric ide

mercurial