diff -r cd22e8e705f4 -r b823386f7591 src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html --- a/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html Sun Feb 16 15:06:29 2025 +0100 +++ b/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html Mon Feb 17 16:28:25 2025 +0100 @@ -31,6 +31,10 @@ <td>Class implementing a node visitor to check datetime function calls.</td> </tr> <tr> +<td><a href="#DefaultMatchCaseVisitor">DefaultMatchCaseVisitor</a></td> +<td>Class implementing a node visitor to check default match cases.</td> +</tr> +<tr> <td><a href="#ExceptBaseExceptionVisitor">ExceptBaseExceptionVisitor</a></td> <td>Class to determine, if a 'BaseException' is re-raised.</td> </tr> @@ -1854,6 +1858,222 @@ <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> +<a NAME="DefaultMatchCaseVisitor" ID="DefaultMatchCaseVisitor"></a> +<h2>DefaultMatchCaseVisitor</h2> +<p> + Class implementing a node visitor to check default match cases. +</p> +<p> + Note: This class is modeled after flake8-spm v0.0.1. +</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="#DefaultMatchCaseVisitor.__init__">DefaultMatchCaseVisitor</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#DefaultMatchCaseVisitor.__badNodes">__badNodes</a></td> +<td>Private method to yield bad match nodes.</td> +</tr> +<tr> +<td><a href="#DefaultMatchCaseVisitor.__emptyMatchDefault">__emptyMatchDefault</a></td> +<td>Private method to check for an empty default match case.</td> +</tr> +<tr> +<td><a href="#DefaultMatchCaseVisitor.__findBadNode">__findBadNode</a></td> +<td>Private method returning a reference to the bad node of a case node.</td> +</tr> +<tr> +<td><a href="#DefaultMatchCaseVisitor.__lastStatementDoesNotRaise">__lastStatementDoesNotRaise</a></td> +<td>Private method to check that the last case statement does not raise an exception.</td> +</tr> +<tr> +<td><a href="#DefaultMatchCaseVisitor.__returnPrecedesExceptionRaising">__returnPrecedesExceptionRaising</a></td> +<td>Private method to check that no return precedes an exception raising.</td> +</tr> +<tr> +<td><a href="#DefaultMatchCaseVisitor.visit_Match">visit_Match</a></td> +<td>Public method to handle Match nodes.</td> +</tr> +</table> + +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + + +<a NAME="DefaultMatchCaseVisitor.__init__" ID="DefaultMatchCaseVisitor.__init__"></a> +<h4>DefaultMatchCaseVisitor (Constructor)</h4> +<b>DefaultMatchCaseVisitor</b>(<i></i>) +<p> + Constructor +</p> + +<a NAME="DefaultMatchCaseVisitor.__badNodes" ID="DefaultMatchCaseVisitor.__badNodes"></a> +<h4>DefaultMatchCaseVisitor.__badNodes</h4> +<b>__badNodes</b>(<i>node</i>) +<p> + Private method to yield bad match nodes. +</p> + +<dl> + +<dt><i>node</i> (ast.Match)</dt> +<dd> +reference to the node to be processed +</dd> +</dl> +<dl> +<dt>Yield:</dt> +<dd> +tuple containing a reference to bad match case node and the corresponding + issue code +</dd> +</dl> +<dl> +<dt>Yield Type:</dt> +<dd> +tyuple of (ast.AST, str) +</dd> +</dl> +<a NAME="DefaultMatchCaseVisitor.__emptyMatchDefault" ID="DefaultMatchCaseVisitor.__emptyMatchDefault"></a> +<h4>DefaultMatchCaseVisitor.__emptyMatchDefault</h4> +<b>__emptyMatchDefault</b>(<i>case</i>) +<p> + Private method to check for an empty default match case. +</p> + +<dl> + +<dt><i>case</i> (ast.match_case)</dt> +<dd> +reference to the node to be processed +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating an empty default match case +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="DefaultMatchCaseVisitor.__findBadNode" ID="DefaultMatchCaseVisitor.__findBadNode"></a> +<h4>DefaultMatchCaseVisitor.__findBadNode</h4> +<b>__findBadNode</b>(<i>case</i>) +<p> + Private method returning a reference to the bad node of a case node. +</p> + +<dl> + +<dt><i>case</i> (ast.match_case)</dt> +<dd> +reference to the node to be processed +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +reference to the bad node +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +ast.AST +</dd> +</dl> +<a NAME="DefaultMatchCaseVisitor.__lastStatementDoesNotRaise" ID="DefaultMatchCaseVisitor.__lastStatementDoesNotRaise"></a> +<h4>DefaultMatchCaseVisitor.__lastStatementDoesNotRaise</h4> +<b>__lastStatementDoesNotRaise</b>(<i>case</i>) +<p> + Private method to check that the last case statement does not raise an + exception. +</p> + +<dl> + +<dt><i>case</i> (ast.match_case)</dt> +<dd> +reference to the node to be processed +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating that the last case statement does not raise an + exception +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="DefaultMatchCaseVisitor.__returnPrecedesExceptionRaising" ID="DefaultMatchCaseVisitor.__returnPrecedesExceptionRaising"></a> +<h4>DefaultMatchCaseVisitor.__returnPrecedesExceptionRaising</h4> +<b>__returnPrecedesExceptionRaising</b>(<i>case</i>) +<p> + Private method to check that no return precedes an exception raising. +</p> + +<dl> + +<dt><i>case</i> (ast.match_case)</dt> +<dd> +reference to the node to be processed +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating that a return precedes an exception raising +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="DefaultMatchCaseVisitor.visit_Match" ID="DefaultMatchCaseVisitor.visit_Match"></a> +<h4>DefaultMatchCaseVisitor.visit_Match</h4> +<b>visit_Match</b>(<i>node</i>) +<p> + Public method to handle Match nodes. +</p> + +<dl> + +<dt><i>node</i> (ast.Match)</dt> +<dd> +reference to the node to be processed +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> <a NAME="ExceptBaseExceptionVisitor" ID="ExceptBaseExceptionVisitor"></a> <h2>ExceptBaseExceptionVisitor</h2> <p> @@ -2510,6 +2730,10 @@ <td>Private method to check use of naive datetime functions.</td> </tr> <tr> +<td><a href="#MiscellaneousChecker.__checkDefaultMatchCase">__checkDefaultMatchCase</a></td> +<td>Private method to check the default match case.</td> +</tr> +<tr> <td><a href="#MiscellaneousChecker.__checkDictWithSortedKeys">__checkDictWithSortedKeys</a></td> <td>Private method to check, if dictionary keys appear in sorted order.</td> </tr> @@ -2693,6 +2917,13 @@ Private method to check use of naive datetime functions. </p> +<a NAME="MiscellaneousChecker.__checkDefaultMatchCase" ID="MiscellaneousChecker.__checkDefaultMatchCase"></a> +<h4>MiscellaneousChecker.__checkDefaultMatchCase</h4> +<b>__checkDefaultMatchCase</b>(<i></i>) +<p> + Private method to check the default match case. +</p> + <a NAME="MiscellaneousChecker.__checkDictWithSortedKeys" ID="MiscellaneousChecker.__checkDictWithSortedKeys"></a> <h4>MiscellaneousChecker.__checkDictWithSortedKeys</h4> <b>__checkDictWithSortedKeys</b>(<i></i>) @@ -3694,7 +3925,7 @@ sys.version_info. </p> <p> - Note: This class is modeled after flake8-2020 checker. + Note: This class is modeled after flake8-2020 v1.8.1. </p> <h3>Derived from</h3>