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

branch
eric7
changeset 11150
73d80859079c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.DefaultMatchCaseVisitor.html	Thu Feb 27 14:42:39 2025 +0100
@@ -0,0 +1,249 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.DefaultMatchCaseVisitor</title>
+<meta charset="UTF-8">
+<link rel="stylesheet" href="styles.css">
+</head>
+<body>
+<a NAME="top" ID="top"></a>
+<h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.DefaultMatchCaseVisitor</h1>
+<p>
+Module implementing a node visitor to check default match cases.
+</p>
+
+<h3>Global Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+
+<h3>Classes</h3>
+<table>
+<tr>
+<td><a href="#DefaultMatchCaseVisitor">DefaultMatchCaseVisitor</a></td>
+<td>Class implementing a node visitor to check default match cases.</td>
+</tr>
+</table>
+
+<h3>Functions</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+
+<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 />
+</body></html>

eric ide

mercurial