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

branch
eric7
changeset 11140
b823386f7591
parent 11139
cd22e8e705f4
child 11150
73d80859079c
equal deleted inserted replaced
11139:cd22e8e705f4 11140:b823386f7591
29 <tr> 29 <tr>
30 <td><a href="#DateTimeVisitor">DateTimeVisitor</a></td> 30 <td><a href="#DateTimeVisitor">DateTimeVisitor</a></td>
31 <td>Class implementing a node visitor to check datetime function calls.</td> 31 <td>Class implementing a node visitor to check datetime function calls.</td>
32 </tr> 32 </tr>
33 <tr> 33 <tr>
34 <td><a href="#DefaultMatchCaseVisitor">DefaultMatchCaseVisitor</a></td>
35 <td>Class implementing a node visitor to check default match cases.</td>
36 </tr>
37 <tr>
34 <td><a href="#ExceptBaseExceptionVisitor">ExceptBaseExceptionVisitor</a></td> 38 <td><a href="#ExceptBaseExceptionVisitor">ExceptBaseExceptionVisitor</a></td>
35 <td>Class to determine, if a 'BaseException' is re-raised.</td> 39 <td>Class to determine, if a 'BaseException' is re-raised.</td>
36 </tr> 40 </tr>
37 <tr> 41 <tr>
38 <td><a href="#FunctionDefDefaultsVisitor">FunctionDefDefaultsVisitor</a></td> 42 <td><a href="#FunctionDefDefaultsVisitor">FunctionDefDefaultsVisitor</a></td>
1852 </dd> 1856 </dd>
1853 </dl> 1857 </dl>
1854 <div align="right"><a href="#top">Up</a></div> 1858 <div align="right"><a href="#top">Up</a></div>
1855 <hr /> 1859 <hr />
1856 <hr /> 1860 <hr />
1861 <a NAME="DefaultMatchCaseVisitor" ID="DefaultMatchCaseVisitor"></a>
1862 <h2>DefaultMatchCaseVisitor</h2>
1863 <p>
1864 Class implementing a node visitor to check default match cases.
1865 </p>
1866 <p>
1867 Note: This class is modeled after flake8-spm v0.0.1.
1868 </p>
1869
1870 <h3>Derived from</h3>
1871 ast.NodeVisitor
1872 <h3>Class Attributes</h3>
1873 <table>
1874 <tr><td>None</td></tr>
1875 </table>
1876
1877 <h3>Class Methods</h3>
1878 <table>
1879 <tr><td>None</td></tr>
1880 </table>
1881
1882 <h3>Methods</h3>
1883 <table>
1884 <tr>
1885 <td><a href="#DefaultMatchCaseVisitor.__init__">DefaultMatchCaseVisitor</a></td>
1886 <td>Constructor</td>
1887 </tr>
1888 <tr>
1889 <td><a href="#DefaultMatchCaseVisitor.__badNodes">__badNodes</a></td>
1890 <td>Private method to yield bad match nodes.</td>
1891 </tr>
1892 <tr>
1893 <td><a href="#DefaultMatchCaseVisitor.__emptyMatchDefault">__emptyMatchDefault</a></td>
1894 <td>Private method to check for an empty default match case.</td>
1895 </tr>
1896 <tr>
1897 <td><a href="#DefaultMatchCaseVisitor.__findBadNode">__findBadNode</a></td>
1898 <td>Private method returning a reference to the bad node of a case node.</td>
1899 </tr>
1900 <tr>
1901 <td><a href="#DefaultMatchCaseVisitor.__lastStatementDoesNotRaise">__lastStatementDoesNotRaise</a></td>
1902 <td>Private method to check that the last case statement does not raise an exception.</td>
1903 </tr>
1904 <tr>
1905 <td><a href="#DefaultMatchCaseVisitor.__returnPrecedesExceptionRaising">__returnPrecedesExceptionRaising</a></td>
1906 <td>Private method to check that no return precedes an exception raising.</td>
1907 </tr>
1908 <tr>
1909 <td><a href="#DefaultMatchCaseVisitor.visit_Match">visit_Match</a></td>
1910 <td>Public method to handle Match nodes.</td>
1911 </tr>
1912 </table>
1913
1914 <h3>Static Methods</h3>
1915 <table>
1916 <tr><td>None</td></tr>
1917 </table>
1918
1919
1920 <a NAME="DefaultMatchCaseVisitor.__init__" ID="DefaultMatchCaseVisitor.__init__"></a>
1921 <h4>DefaultMatchCaseVisitor (Constructor)</h4>
1922 <b>DefaultMatchCaseVisitor</b>(<i></i>)
1923 <p>
1924 Constructor
1925 </p>
1926
1927 <a NAME="DefaultMatchCaseVisitor.__badNodes" ID="DefaultMatchCaseVisitor.__badNodes"></a>
1928 <h4>DefaultMatchCaseVisitor.__badNodes</h4>
1929 <b>__badNodes</b>(<i>node</i>)
1930 <p>
1931 Private method to yield bad match nodes.
1932 </p>
1933
1934 <dl>
1935
1936 <dt><i>node</i> (ast.Match)</dt>
1937 <dd>
1938 reference to the node to be processed
1939 </dd>
1940 </dl>
1941 <dl>
1942 <dt>Yield:</dt>
1943 <dd>
1944 tuple containing a reference to bad match case node and the corresponding
1945 issue code
1946 </dd>
1947 </dl>
1948 <dl>
1949 <dt>Yield Type:</dt>
1950 <dd>
1951 tyuple of (ast.AST, str)
1952 </dd>
1953 </dl>
1954 <a NAME="DefaultMatchCaseVisitor.__emptyMatchDefault" ID="DefaultMatchCaseVisitor.__emptyMatchDefault"></a>
1955 <h4>DefaultMatchCaseVisitor.__emptyMatchDefault</h4>
1956 <b>__emptyMatchDefault</b>(<i>case</i>)
1957 <p>
1958 Private method to check for an empty default match case.
1959 </p>
1960
1961 <dl>
1962
1963 <dt><i>case</i> (ast.match_case)</dt>
1964 <dd>
1965 reference to the node to be processed
1966 </dd>
1967 </dl>
1968 <dl>
1969 <dt>Return:</dt>
1970 <dd>
1971 flag indicating an empty default match case
1972 </dd>
1973 </dl>
1974 <dl>
1975 <dt>Return Type:</dt>
1976 <dd>
1977 bool
1978 </dd>
1979 </dl>
1980 <a NAME="DefaultMatchCaseVisitor.__findBadNode" ID="DefaultMatchCaseVisitor.__findBadNode"></a>
1981 <h4>DefaultMatchCaseVisitor.__findBadNode</h4>
1982 <b>__findBadNode</b>(<i>case</i>)
1983 <p>
1984 Private method returning a reference to the bad node of a case node.
1985 </p>
1986
1987 <dl>
1988
1989 <dt><i>case</i> (ast.match_case)</dt>
1990 <dd>
1991 reference to the node to be processed
1992 </dd>
1993 </dl>
1994 <dl>
1995 <dt>Return:</dt>
1996 <dd>
1997 reference to the bad node
1998 </dd>
1999 </dl>
2000 <dl>
2001 <dt>Return Type:</dt>
2002 <dd>
2003 ast.AST
2004 </dd>
2005 </dl>
2006 <a NAME="DefaultMatchCaseVisitor.__lastStatementDoesNotRaise" ID="DefaultMatchCaseVisitor.__lastStatementDoesNotRaise"></a>
2007 <h4>DefaultMatchCaseVisitor.__lastStatementDoesNotRaise</h4>
2008 <b>__lastStatementDoesNotRaise</b>(<i>case</i>)
2009 <p>
2010 Private method to check that the last case statement does not raise an
2011 exception.
2012 </p>
2013
2014 <dl>
2015
2016 <dt><i>case</i> (ast.match_case)</dt>
2017 <dd>
2018 reference to the node to be processed
2019 </dd>
2020 </dl>
2021 <dl>
2022 <dt>Return:</dt>
2023 <dd>
2024 flag indicating that the last case statement does not raise an
2025 exception
2026 </dd>
2027 </dl>
2028 <dl>
2029 <dt>Return Type:</dt>
2030 <dd>
2031 bool
2032 </dd>
2033 </dl>
2034 <a NAME="DefaultMatchCaseVisitor.__returnPrecedesExceptionRaising" ID="DefaultMatchCaseVisitor.__returnPrecedesExceptionRaising"></a>
2035 <h4>DefaultMatchCaseVisitor.__returnPrecedesExceptionRaising</h4>
2036 <b>__returnPrecedesExceptionRaising</b>(<i>case</i>)
2037 <p>
2038 Private method to check that no return precedes an exception raising.
2039 </p>
2040
2041 <dl>
2042
2043 <dt><i>case</i> (ast.match_case)</dt>
2044 <dd>
2045 reference to the node to be processed
2046 </dd>
2047 </dl>
2048 <dl>
2049 <dt>Return:</dt>
2050 <dd>
2051 flag indicating that a return precedes an exception raising
2052 </dd>
2053 </dl>
2054 <dl>
2055 <dt>Return Type:</dt>
2056 <dd>
2057 bool
2058 </dd>
2059 </dl>
2060 <a NAME="DefaultMatchCaseVisitor.visit_Match" ID="DefaultMatchCaseVisitor.visit_Match"></a>
2061 <h4>DefaultMatchCaseVisitor.visit_Match</h4>
2062 <b>visit_Match</b>(<i>node</i>)
2063 <p>
2064 Public method to handle Match nodes.
2065 </p>
2066
2067 <dl>
2068
2069 <dt><i>node</i> (ast.Match)</dt>
2070 <dd>
2071 reference to the node to be processed
2072 </dd>
2073 </dl>
2074 <div align="right"><a href="#top">Up</a></div>
2075 <hr />
2076 <hr />
1857 <a NAME="ExceptBaseExceptionVisitor" ID="ExceptBaseExceptionVisitor"></a> 2077 <a NAME="ExceptBaseExceptionVisitor" ID="ExceptBaseExceptionVisitor"></a>
1858 <h2>ExceptBaseExceptionVisitor</h2> 2078 <h2>ExceptBaseExceptionVisitor</h2>
1859 <p> 2079 <p>
1860 Class to determine, if a 'BaseException' is re-raised. 2080 Class to determine, if a 'BaseException' is re-raised.
1861 </p> 2081 </p>
2508 <tr> 2728 <tr>
2509 <td><a href="#MiscellaneousChecker.__checkDateTime">__checkDateTime</a></td> 2729 <td><a href="#MiscellaneousChecker.__checkDateTime">__checkDateTime</a></td>
2510 <td>Private method to check use of naive datetime functions.</td> 2730 <td>Private method to check use of naive datetime functions.</td>
2511 </tr> 2731 </tr>
2512 <tr> 2732 <tr>
2733 <td><a href="#MiscellaneousChecker.__checkDefaultMatchCase">__checkDefaultMatchCase</a></td>
2734 <td>Private method to check the default match case.</td>
2735 </tr>
2736 <tr>
2513 <td><a href="#MiscellaneousChecker.__checkDictWithSortedKeys">__checkDictWithSortedKeys</a></td> 2737 <td><a href="#MiscellaneousChecker.__checkDictWithSortedKeys">__checkDictWithSortedKeys</a></td>
2514 <td>Private method to check, if dictionary keys appear in sorted order.</td> 2738 <td>Private method to check, if dictionary keys appear in sorted order.</td>
2515 </tr> 2739 </tr>
2516 <tr> 2740 <tr>
2517 <td><a href="#MiscellaneousChecker.__checkExplicitStringConcat">__checkExplicitStringConcat</a></td> 2741 <td><a href="#MiscellaneousChecker.__checkExplicitStringConcat">__checkExplicitStringConcat</a></td>
2689 <a NAME="MiscellaneousChecker.__checkDateTime" ID="MiscellaneousChecker.__checkDateTime"></a> 2913 <a NAME="MiscellaneousChecker.__checkDateTime" ID="MiscellaneousChecker.__checkDateTime"></a>
2690 <h4>MiscellaneousChecker.__checkDateTime</h4> 2914 <h4>MiscellaneousChecker.__checkDateTime</h4>
2691 <b>__checkDateTime</b>(<i></i>) 2915 <b>__checkDateTime</b>(<i></i>)
2692 <p> 2916 <p>
2693 Private method to check use of naive datetime functions. 2917 Private method to check use of naive datetime functions.
2918 </p>
2919
2920 <a NAME="MiscellaneousChecker.__checkDefaultMatchCase" ID="MiscellaneousChecker.__checkDefaultMatchCase"></a>
2921 <h4>MiscellaneousChecker.__checkDefaultMatchCase</h4>
2922 <b>__checkDefaultMatchCase</b>(<i></i>)
2923 <p>
2924 Private method to check the default match case.
2694 </p> 2925 </p>
2695 2926
2696 <a NAME="MiscellaneousChecker.__checkDictWithSortedKeys" ID="MiscellaneousChecker.__checkDictWithSortedKeys"></a> 2927 <a NAME="MiscellaneousChecker.__checkDictWithSortedKeys" ID="MiscellaneousChecker.__checkDictWithSortedKeys"></a>
2697 <h4>MiscellaneousChecker.__checkDictWithSortedKeys</h4> 2928 <h4>MiscellaneousChecker.__checkDictWithSortedKeys</h4>
2698 <b>__checkDictWithSortedKeys</b>(<i></i>) 2929 <b>__checkDictWithSortedKeys</b>(<i></i>)
3692 <p> 3923 <p>
3693 Class implementing a node visitor to check the use of sys.version and 3924 Class implementing a node visitor to check the use of sys.version and
3694 sys.version_info. 3925 sys.version_info.
3695 </p> 3926 </p>
3696 <p> 3927 <p>
3697 Note: This class is modeled after flake8-2020 checker. 3928 Note: This class is modeled after flake8-2020 v1.8.1.
3698 </p> 3929 </p>
3699 3930
3700 <h3>Derived from</h3> 3931 <h3>Derived from</h3>
3701 ast.NodeVisitor 3932 ast.NodeVisitor
3702 <h3>Class Attributes</h3> 3933 <h3>Class Attributes</h3>

eric ide

mercurial