diff -r 29384109306c -r 789e88d94899 Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html --- a/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html Sun Mar 11 19:38:33 2018 +0100 +++ b/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.MiscellaneousChecker.html Mon Mar 12 19:37:23 2018 +0100 @@ -30,20 +30,167 @@ <h3>Classes</h3> <table> <tr> +<td><a href="#BugBearVisitor">BugBearVisitor</a></td> +<td>Class implementing a node visitor to check for various topics.</td> +</tr><tr> <td><a href="#LoggingVisitor">LoggingVisitor</a></td> <td>Class implementing a node visitor to check logging statements.</td> </tr><tr> <td><a href="#MiscellaneousChecker">MiscellaneousChecker</a></td> <td>Class implementing a checker for miscellaneous checks.</td> </tr><tr> +<td><a href="#NameFinder">NameFinder</a></td> +<td>Class to extract a name out of a tree of nodes.</td> +</tr><tr> <td><a href="#TextVisitor">TextVisitor</a></td> <td>Class implementing a node visitor for bytes and str instances.</td> </tr> </table> <h3>Functions</h3> <table> +<tr> +<td><a href="#composeCallPath">composeCallPath</a></td> +<td>Generator function to assemble the call path of a given node.</td> +</tr> +</table> +<hr /><hr /> +<a NAME="BugBearVisitor" ID="BugBearVisitor"></a> +<h2>BugBearVisitor</h2> +<p> + Class implementing a node visitor to check for various topics. +</p> +<h3>Derived from</h3> +ast.NodeVisitor +<h3>Class Attributes</h3> +<table> +<tr><td>NodeWindowSize</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#BugBearVisitor.__init__">BugBearVisitor</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#BugBearVisitor.__checkForM502">__checkForM502</a></td> +<td>Private method to check the use of *strip().</td> +</tr><tr> +<td><a href="#BugBearVisitor.__checkForM507">__checkForM507</a></td> +<td>Private method to check for unused loop variables.</td> +</tr><tr> +<td><a href="#BugBearVisitor.visit">visit</a></td> +<td>Public method to traverse a given AST node.</td> +</tr><tr> +<td><a href="#BugBearVisitor.visit_Assign">visit_Assign</a></td> +<td>Public method to handle assignments.</td> +</tr><tr> +<td><a href="#BugBearVisitor.visit_Attribute">visit_Attribute</a></td> +<td>Public method to handle attributes.</td> +</tr><tr> +<td><a href="#BugBearVisitor.visit_Call">visit_Call</a></td> +<td>Public method to handle a function call.</td> +</tr><tr> +<td><a href="#BugBearVisitor.visit_For">visit_For</a></td> +<td>Public method to handle 'for' statements.</td> +</tr><tr> +<td><a href="#BugBearVisitor.visit_UAdd">visit_UAdd</a></td> +<td>Public method to handle unary additions.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> <tr><td>None</td></tr> </table> +<a NAME="BugBearVisitor.__init__" ID="BugBearVisitor.__init__"></a> +<h4>BugBearVisitor (Constructor)</h4> +<b>BugBearVisitor</b>(<i></i>) +<p> + Constructor +</p><a NAME="BugBearVisitor.__checkForM502" ID="BugBearVisitor.__checkForM502"></a> +<h4>BugBearVisitor.__checkForM502</h4> +<b>__checkForM502</b>(<i>node</i>) +<p> + Private method to check the use of *strip(). +</p><dl> +<dt><i>node</i> (ast.Call)</dt> +<dd> +reference to the node to be processed +</dd> +</dl><a NAME="BugBearVisitor.__checkForM507" ID="BugBearVisitor.__checkForM507"></a> +<h4>BugBearVisitor.__checkForM507</h4> +<b>__checkForM507</b>(<i>node</i>) +<p> + Private method to check for unused loop variables. +</p><dl> +<dt><i>node</i> (ast.For)</dt> +<dd> +reference to the node to be processed +</dd> +</dl><a NAME="BugBearVisitor.visit" ID="BugBearVisitor.visit"></a> +<h4>BugBearVisitor.visit</h4> +<b>visit</b>(<i>node</i>) +<p> + Public method to traverse a given AST node. +</p><dl> +<dt><i>node</i> (ast.Node)</dt> +<dd> +AST node to be traversed +</dd> +</dl><a NAME="BugBearVisitor.visit_Assign" ID="BugBearVisitor.visit_Assign"></a> +<h4>BugBearVisitor.visit_Assign</h4> +<b>visit_Assign</b>(<i>node</i>) +<p> + Public method to handle assignments. +</p><dl> +<dt><i>node</i> (ast.Assign)</dt> +<dd> +reference to the node to be processed +</dd> +</dl><a NAME="BugBearVisitor.visit_Attribute" ID="BugBearVisitor.visit_Attribute"></a> +<h4>BugBearVisitor.visit_Attribute</h4> +<b>visit_Attribute</b>(<i>node</i>) +<p> + Public method to handle attributes. +</p><dl> +<dt><i>node</i> (ast.Attribute)</dt> +<dd> +reference to the node to be processed +</dd> +</dl><a NAME="BugBearVisitor.visit_Call" ID="BugBearVisitor.visit_Call"></a> +<h4>BugBearVisitor.visit_Call</h4> +<b>visit_Call</b>(<i>node</i>) +<p> + Public method to handle a function call. +</p><dl> +<dt><i>node</i> (ast.Call)</dt> +<dd> +reference to the node to be processed +</dd> +</dl><a NAME="BugBearVisitor.visit_For" ID="BugBearVisitor.visit_For"></a> +<h4>BugBearVisitor.visit_For</h4> +<b>visit_For</b>(<i>node</i>) +<p> + Public method to handle 'for' statements. +</p><dl> +<dt><i>node</i> (ast.For)</dt> +<dd> +reference to the node to be processed +</dd> +</dl><a NAME="BugBearVisitor.visit_UAdd" ID="BugBearVisitor.visit_UAdd"></a> +<h4>BugBearVisitor.visit_UAdd</h4> +<b>visit_UAdd</b>(<i>node</i>) +<p> + Public method to handle unary additions. +</p><dl> +<dt><i>node</i> (ast.UAdd)</dt> +<dd> +reference to the node to be processed +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> <hr /><hr /> <a NAME="LoggingVisitor" ID="LoggingVisitor"></a> <h2>LoggingVisitor</h2> @@ -248,6 +395,9 @@ <td><a href="#MiscellaneousChecker.__init__">MiscellaneousChecker</a></td> <td>Constructor</td> </tr><tr> +<td><a href="#MiscellaneousChecker.__checkBugBear">__checkBugBear</a></td> +<td>Private method to bugbear checks.</td> +</tr><tr> <td><a href="#MiscellaneousChecker.__checkBuiltins">__checkBuiltins</a></td> <td>Private method to check, if built-ins are shadowed.</td> </tr><tr> @@ -341,7 +491,12 @@ <dd> dictionary of arguments for the miscellaneous checks </dd> -</dl><a NAME="MiscellaneousChecker.__checkBuiltins" ID="MiscellaneousChecker.__checkBuiltins"></a> +</dl><a NAME="MiscellaneousChecker.__checkBugBear" ID="MiscellaneousChecker.__checkBugBear"></a> +<h4>MiscellaneousChecker.__checkBugBear</h4> +<b>__checkBugBear</b>(<i></i>) +<p> + Private method to bugbear checks. +</p><a NAME="MiscellaneousChecker.__checkBuiltins" ID="MiscellaneousChecker.__checkBuiltins"></a> <h4>MiscellaneousChecker.__checkBuiltins</h4> <b>__checkBuiltins</b>(<i></i>) <p> @@ -516,6 +671,84 @@ </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="NameFinder" ID="NameFinder"></a> +<h2>NameFinder</h2> +<p> + Class to extract a name out of a tree of nodes. +</p> +<h3>Derived from</h3> +ast.NodeVisitor +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#NameFinder.__init__">NameFinder</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#NameFinder.getNames">getNames</a></td> +<td>Public method to return the extracted names and Name nodes.</td> +</tr><tr> +<td><a href="#NameFinder.visit">visit</a></td> +<td>Public method to traverse a given AST node.</td> +</tr><tr> +<td><a href="#NameFinder.visit_Name">visit_Name</a></td> +<td>Public method to handle 'Name' nodes.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="NameFinder.__init__" ID="NameFinder.__init__"></a> +<h4>NameFinder (Constructor)</h4> +<b>NameFinder</b>(<i></i>) +<p> + Constructor +</p><a NAME="NameFinder.getNames" ID="NameFinder.getNames"></a> +<h4>NameFinder.getNames</h4> +<b>getNames</b>(<i></i>) +<p> + Public method to return the extracted names and Name nodes. +</p><dl> +<dt>Returns:</dt> +<dd> +dictionary containing the names as keys and the list of nodes +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +dict +</dd> +</dl><a NAME="NameFinder.visit" ID="NameFinder.visit"></a> +<h4>NameFinder.visit</h4> +<b>visit</b>(<i>node</i>) +<p> + Public method to traverse a given AST node. +</p><dl> +<dt><i>node</i> (ast.Node)</dt> +<dd> +AST node to be traversed +</dd> +</dl><a NAME="NameFinder.visit_Name" ID="NameFinder.visit_Name"></a> +<h4>NameFinder.visit_Name</h4> +<b>visit_Name</b>(<i>node</i>) +<p> + Public method to handle 'Name' nodes. +</p><dl> +<dt><i>node</i> (ast.Name)</dt> +<dd> +reference to the node to be processed +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> <a NAME="TextVisitor" ID="TextVisitor"></a> <h2>TextVisitor</h2> <p> @@ -552,6 +785,9 @@ <td><a href="#TextVisitor.__visitDefinition">__visitDefinition</a></td> <td>Private method handling class and function definitions.</td> </tr><tr> +<td><a href="#TextVisitor.visit_AsyncFunctionDef">visit_AsyncFunctionDef</a></td> +<td>Public method to handle an asynchronous function definition.</td> +</tr><tr> <td><a href="#TextVisitor.visit_Bytes">visit_Bytes</a></td> <td>Public method to record a bytes node.</td> </tr><tr> @@ -629,7 +865,17 @@ <p> Private method handling class and function definitions. </p><dl> -<dt><i>node</i> (ast.FunctionDef or ast.ClassDef)</dt> +<dt><i>node</i> (ast.FunctionDef, ast.AsyncFunctionDef or ast.ClassDef)</dt> +<dd> +reference to the node to handle +</dd> +</dl><a NAME="TextVisitor.visit_AsyncFunctionDef" ID="TextVisitor.visit_AsyncFunctionDef"></a> +<h4>TextVisitor.visit_AsyncFunctionDef</h4> +<b>visit_AsyncFunctionDef</b>(<i>node</i>) +<p> + Public method to handle an asynchronous function definition. +</p><dl> +<dt><i>node</i> (ast.AsyncFunctionDef)</dt> <dd> reference to the node to handle </dd> @@ -695,5 +941,28 @@ </dd> </dl> <div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="composeCallPath" ID="composeCallPath"></a> +<h2>composeCallPath</h2> +<b>composeCallPath</b>(<i>node</i>) +<p> + Generator function to assemble the call path of a given node. +</p><dl> +<dt><i>node</i> (ast.Node)</dt> +<dd> +node to assemble call path for +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +call path components +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> <hr /> </body></html> \ No newline at end of file