src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html

branch
eric7
changeset 10048
df836ff707fd
parent 9596
397f385b95d8
child 10085
b5808c3a9967
--- a/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html	Sun May 21 16:04:59 2023 +0200
+++ b/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html	Mon May 22 08:43:23 2023 +0200
@@ -116,7 +116,7 @@
 </tr>
 <tr>
 <td><a href="#BugBearVisitor.__checkForM517">__checkForM517</a></td>
-<td>Private method to check for use of the evil syntax 'with assertRaises(Exception):.</td>
+<td>Private method to check for use of the evil syntax 'with assertRaises(Exception): or 'with pytest.raises(Exception):'.</td>
 </tr>
 <tr>
 <td><a href="#BugBearVisitor.__checkForM518">__checkForM518</a></td>
@@ -155,6 +155,26 @@
 <td>Private method to check for Star-arg unpacking after keyword argument.</td>
 </tr>
 <tr>
+<td><a href="#BugBearVisitor.__checkForM528">__checkForM528</a></td>
+<td>Private method to check for warn without stacklevel.</td>
+</tr>
+<tr>
+<td><a href="#BugBearVisitor.__checkForM531">__checkForM531</a></td>
+<td>Private method to check that 'itertools.groupby' isn't iterated over more than once.</td>
+</tr>
+<tr>
+<td><a href="#BugBearVisitor.__checkForM532">__checkForM532</a></td>
+<td>Private method to check for possible unintentional typing annotation.</td>
+</tr>
+<tr>
+<td><a href="#BugBearVisitor.__checkForM533">__checkForM533</a></td>
+<td>Private method to check a set for duplicate items.</td>
+</tr>
+<tr>
+<td><a href="#BugBearVisitor.__checkRedundantExcepthandlers">__checkRedundantExcepthandlers</a></td>
+<td>Private method to check for redundant exception types in an exception handler.</td>
+</tr>
+<tr>
 <td><a href="#BugBearVisitor.__childrenInScope">__childrenInScope</a></td>
 <td>Private method to get all child nodes in the given scope.</td>
 </tr>
@@ -163,6 +183,10 @@
 <td>Private method get the individual elements of the call path of a node.</td>
 </tr>
 <tr>
+<td><a href="#BugBearVisitor.__flattenExcepthandler">__flattenExcepthandler</a></td>
+<td>Private method to flatten the list of exceptions handled by an except handler.</td>
+</tr>
+<tr>
 <td><a href="#BugBearVisitor.__getAssignedNames">__getAssignedNames</a></td>
 <td>Private method to get the names of a for loop.</td>
 </tr>
@@ -183,6 +207,10 @@
 <td>Private method implementing a type safe issubclass() function.</td>
 </tr>
 <tr>
+<td><a href="#BugBearVisitor.__walkList">__walkList</a></td>
+<td>Private method to walk a given list of nodes.</td>
+</tr>
+<tr>
 <td><a href="#BugBearVisitor._loop">_loop</a></td>
 <td></td>
 </tr>
@@ -215,6 +243,10 @@
 <td>Public method to traverse a given AST node.</td>
 </tr>
 <tr>
+<td><a href="#BugBearVisitor.visit_AnnAssign">visit_AnnAssign</a></td>
+<td>Public method to check annotated assign statements.</td>
+</tr>
+<tr>
 <td><a href="#BugBearVisitor.visit_Assert">visit_Assert</a></td>
 <td>Public method to handle 'assert' statements.</td>
 </tr>
@@ -259,6 +291,10 @@
 <td>Public method to handle generator expressions.</td>
 </tr>
 <tr>
+<td><a href="#BugBearVisitor.visit_Import">visit_Import</a></td>
+<td>Public method to check imports.</td>
+</tr>
+<tr>
 <td><a href="#BugBearVisitor.visit_JoinedStr">visit_JoinedStr</a></td>
 <td>Public method to handle f-string arguments.</td>
 </tr>
@@ -267,10 +303,18 @@
 <td>Public method to handle list comprehensions.</td>
 </tr>
 <tr>
+<td><a href="#BugBearVisitor.visit_Module">visit_Module</a></td>
+<td>Public method to handle a module node.</td>
+</tr>
+<tr>
 <td><a href="#BugBearVisitor.visit_Raise">visit_Raise</a></td>
 <td>Public method to handle 'raise' statements.</td>
 </tr>
 <tr>
+<td><a href="#BugBearVisitor.visit_Set">visit_Set</a></td>
+<td>Public method to check a set.</td>
+</tr>
+<tr>
 <td><a href="#BugBearVisitor.visit_SetComp">visit_SetComp</a></td>
 <td>Public method to handle set comprehensions.</td>
 </tr>
@@ -380,7 +424,7 @@
 
 <p>
         Private method to check for use of the evil syntax
-        'with assertRaises(Exception):.
+        'with assertRaises(Exception): or 'with pytest.raises(Exception):'.
 </p>
 <dl>
 
@@ -518,6 +562,97 @@
 reference to the node to be processed
 </dd>
 </dl>
+<a NAME="BugBearVisitor.__checkForM528" ID="BugBearVisitor.__checkForM528"></a>
+<h4>BugBearVisitor.__checkForM528</h4>
+<b>__checkForM528</b>(<i>node</i>)
+
+<p>
+        Private method to check for warn without stacklevel.
+</p>
+<dl>
+
+<dt><i>node</i> (ast.Call)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
+<a NAME="BugBearVisitor.__checkForM531" ID="BugBearVisitor.__checkForM531"></a>
+<h4>BugBearVisitor.__checkForM531</h4>
+<b>__checkForM531</b>(<i>loopNode</i>)
+
+<p>
+        Private method to check that 'itertools.groupby' isn't iterated over more than
+        once.
+</p>
+<p>
+        A warning is emitted when the generator returned by 'groupby()' is used
+        more than once inside a loop body or when it's used in a nested loop.
+</p>
+<dl>
+
+<dt><i>loopNode</i> (ast.For or ast.AsyncFor)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
+<a NAME="BugBearVisitor.__checkForM532" ID="BugBearVisitor.__checkForM532"></a>
+<h4>BugBearVisitor.__checkForM532</h4>
+<b>__checkForM532</b>(<i>node</i>)
+
+<p>
+        Private method to check for possible unintentional typing annotation.
+</p>
+<dl>
+
+<dt><i>node</i> (ast.AnnAssign)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
+<a NAME="BugBearVisitor.__checkForM533" ID="BugBearVisitor.__checkForM533"></a>
+<h4>BugBearVisitor.__checkForM533</h4>
+<b>__checkForM533</b>(<i>node</i>)
+
+<p>
+        Private method to check a set for duplicate items.
+</p>
+<dl>
+
+<dt><i>node</i> (ast.Set)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
+<a NAME="BugBearVisitor.__checkRedundantExcepthandlers" ID="BugBearVisitor.__checkRedundantExcepthandlers"></a>
+<h4>BugBearVisitor.__checkRedundantExcepthandlers</h4>
+<b>__checkRedundantExcepthandlers</b>(<i>names, node</i>)
+
+<p>
+        Private method to check for redundant exception types in an exception handler.
+</p>
+<dl>
+
+<dt><i>names</i> (list of ast.Name)</dt>
+<dd>
+list of exception types to be checked
+</dd>
+<dt><i>node</i> (ast.ExceptionHandler)</dt>
+<dd>
+reference to the exception handler node
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing the error data
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (ast.Node, str, str, str, str)
+</dd>
+</dl>
 <a NAME="BugBearVisitor.__childrenInScope" ID="BugBearVisitor.__childrenInScope"></a>
 <h4>BugBearVisitor.__childrenInScope</h4>
 <b>__childrenInScope</b>(<i>node</i>)
@@ -570,6 +705,32 @@
 ast.Node
 </dd>
 </dl>
+<a NAME="BugBearVisitor.__flattenExcepthandler" ID="BugBearVisitor.__flattenExcepthandler"></a>
+<h4>BugBearVisitor.__flattenExcepthandler</h4>
+<b>__flattenExcepthandler</b>(<i>node</i>)
+
+<p>
+        Private method to flatten the list of exceptions handled by an except handler.
+</p>
+<dl>
+
+<dt><i>node</i> (ast.Node)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
+<dl>
+<dt>Yield:</dt>
+<dd>
+reference to the exception type node
+</dd>
+</dl>
+<dl>
+<dt>Yield Type:</dt>
+<dd>
+ast.Node
+</dd>
+</dl>
 <a NAME="BugBearVisitor.__getAssignedNames" ID="BugBearVisitor.__getAssignedNames"></a>
 <h4>BugBearVisitor.__getAssignedNames</h4>
 <b>__getAssignedNames</b>(<i>loopNode</i>)
@@ -711,6 +872,32 @@
 bool
 </dd>
 </dl>
+<a NAME="BugBearVisitor.__walkList" ID="BugBearVisitor.__walkList"></a>
+<h4>BugBearVisitor.__walkList</h4>
+<b>__walkList</b>(<i>nodes</i>)
+
+<p>
+        Private method to walk a given list of nodes.
+</p>
+<dl>
+
+<dt><i>nodes</i> (list of ast.Node)</dt>
+<dd>
+list of nodes to walk
+</dd>
+</dl>
+<dl>
+<dt>Yield:</dt>
+<dd>
+node references as determined by the ast.walk() function
+</dd>
+</dl>
+<dl>
+<dt>Yield Type:</dt>
+<dd>
+ast.Node
+</dd>
+</dl>
 <a NAME="BugBearVisitor._loop" ID="BugBearVisitor._loop"></a>
 <h4>BugBearVisitor._loop</h4>
 <b>_loop</b>(<i>badNodeTypes</i>)
@@ -768,6 +955,20 @@
 AST node to be traversed
 </dd>
 </dl>
+<a NAME="BugBearVisitor.visit_AnnAssign" ID="BugBearVisitor.visit_AnnAssign"></a>
+<h4>BugBearVisitor.visit_AnnAssign</h4>
+<b>visit_AnnAssign</b>(<i>node</i>)
+
+<p>
+        Public method to check annotated assign statements.
+</p>
+<dl>
+
+<dt><i>node</i> (ast.AnnAssign)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
 <a NAME="BugBearVisitor.visit_Assert" ID="BugBearVisitor.visit_Assert"></a>
 <h4>BugBearVisitor.visit_Assert</h4>
 <b>visit_Assert</b>(<i>node</i>)
@@ -922,6 +1123,20 @@
 reference to the node to be processed
 </dd>
 </dl>
+<a NAME="BugBearVisitor.visit_Import" ID="BugBearVisitor.visit_Import"></a>
+<h4>BugBearVisitor.visit_Import</h4>
+<b>visit_Import</b>(<i>node</i>)
+
+<p>
+        Public method to check imports.
+</p>
+<dl>
+
+<dt><i>node</i> (ast.Import)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
 <a NAME="BugBearVisitor.visit_JoinedStr" ID="BugBearVisitor.visit_JoinedStr"></a>
 <h4>BugBearVisitor.visit_JoinedStr</h4>
 <b>visit_JoinedStr</b>(<i>node</i>)
@@ -950,6 +1165,20 @@
 reference to the node to be processed
 </dd>
 </dl>
+<a NAME="BugBearVisitor.visit_Module" ID="BugBearVisitor.visit_Module"></a>
+<h4>BugBearVisitor.visit_Module</h4>
+<b>visit_Module</b>(<i>node</i>)
+
+<p>
+        Public method to handle a module node.
+</p>
+<dl>
+
+<dt><i>node</i> (ast.Module)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
 <a NAME="BugBearVisitor.visit_Raise" ID="BugBearVisitor.visit_Raise"></a>
 <h4>BugBearVisitor.visit_Raise</h4>
 <b>visit_Raise</b>(<i>node</i>)
@@ -964,6 +1193,20 @@
 reference to the node to be processed
 </dd>
 </dl>
+<a NAME="BugBearVisitor.visit_Set" ID="BugBearVisitor.visit_Set"></a>
+<h4>BugBearVisitor.visit_Set</h4>
+<b>visit_Set</b>(<i>node</i>)
+
+<p>
+        Public method to check a set.
+</p>
+<dl>
+
+<dt><i>node</i> (ast.Set)</dt>
+<dd>
+reference to the node to be processed
+</dd>
+</dl>
 <a NAME="BugBearVisitor.visit_SetComp" ID="BugBearVisitor.visit_SetComp"></a>
 <h4>BugBearVisitor.visit_SetComp</h4>
 <b>visit_SetComp</b>(<i>node</i>)

eric ide

mercurial