|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Simplify.SimplifyChecker</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Simplify.SimplifyChecker</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the checker for simplifying Python code. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#SimplifyChecker">SimplifyChecker</a></td> |
|
25 <td>Class implementing a checker for to help simplifying Python code.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="SimplifyChecker" ID="SimplifyChecker"></a> |
|
36 <h2>SimplifyChecker</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing a checker for to help simplifying Python code. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 None |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>Codes</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#SimplifyChecker.__init__">SimplifyChecker</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#SimplifyChecker.__error">__error</a></td> |
|
63 <td>Private method to record an issue.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#SimplifyChecker.__ignoreCode">__ignoreCode</a></td> |
|
67 <td>Private method to check if the message code should be ignored.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#SimplifyChecker.run">run</a></td> |
|
71 <td>Public method to check the given source against functions to be replaced by 'pathlib' equivalents.</td> |
|
72 </tr> |
|
73 </table> |
|
74 <h3>Static Methods</h3> |
|
75 |
|
76 <table> |
|
77 <tr><td>None</td></tr> |
|
78 </table> |
|
79 |
|
80 <a NAME="SimplifyChecker.__init__" ID="SimplifyChecker.__init__"></a> |
|
81 <h4>SimplifyChecker (Constructor)</h4> |
|
82 <b>SimplifyChecker</b>(<i>source, filename, tree, selected, ignored, expected, repeat</i>) |
|
83 |
|
84 <p> |
|
85 Constructor |
|
86 </p> |
|
87 <dl> |
|
88 |
|
89 <dt><i>source</i> (list of str)</dt> |
|
90 <dd> |
|
91 source code to be checked |
|
92 </dd> |
|
93 <dt><i>filename</i> (str)</dt> |
|
94 <dd> |
|
95 name of the source file |
|
96 </dd> |
|
97 <dt><i>tree</i> (ast.Module)</dt> |
|
98 <dd> |
|
99 AST tree of the source code |
|
100 </dd> |
|
101 <dt><i>selected</i> (list of str)</dt> |
|
102 <dd> |
|
103 list of selected codes |
|
104 </dd> |
|
105 <dt><i>ignored</i> (list of str)</dt> |
|
106 <dd> |
|
107 list of codes to be ignored |
|
108 </dd> |
|
109 <dt><i>expected</i> (list of str)</dt> |
|
110 <dd> |
|
111 list of expected codes |
|
112 </dd> |
|
113 <dt><i>repeat</i> (bool)</dt> |
|
114 <dd> |
|
115 flag indicating to report each occurrence of a code |
|
116 </dd> |
|
117 </dl> |
|
118 <a NAME="SimplifyChecker.__error" ID="SimplifyChecker.__error"></a> |
|
119 <h4>SimplifyChecker.__error</h4> |
|
120 <b>__error</b>(<i>lineNumber, offset, code, *args</i>) |
|
121 |
|
122 <p> |
|
123 Private method to record an issue. |
|
124 </p> |
|
125 <dl> |
|
126 |
|
127 <dt><i>lineNumber</i> (int)</dt> |
|
128 <dd> |
|
129 line number of the issue |
|
130 </dd> |
|
131 <dt><i>offset</i> (int)</dt> |
|
132 <dd> |
|
133 position within line of the issue |
|
134 </dd> |
|
135 <dt><i>code</i> (str)</dt> |
|
136 <dd> |
|
137 message code |
|
138 </dd> |
|
139 <dt><i>args</i> (list)</dt> |
|
140 <dd> |
|
141 arguments for the message |
|
142 </dd> |
|
143 </dl> |
|
144 <a NAME="SimplifyChecker.__ignoreCode" ID="SimplifyChecker.__ignoreCode"></a> |
|
145 <h4>SimplifyChecker.__ignoreCode</h4> |
|
146 <b>__ignoreCode</b>(<i>code</i>) |
|
147 |
|
148 <p> |
|
149 Private method to check if the message code should be ignored. |
|
150 </p> |
|
151 <dl> |
|
152 |
|
153 <dt><i>code</i> (str)</dt> |
|
154 <dd> |
|
155 message code to check for |
|
156 </dd> |
|
157 </dl> |
|
158 <dl> |
|
159 <dt>Return:</dt> |
|
160 <dd> |
|
161 flag indicating to ignore the given code |
|
162 </dd> |
|
163 </dl> |
|
164 <dl> |
|
165 <dt>Return Type:</dt> |
|
166 <dd> |
|
167 bool |
|
168 </dd> |
|
169 </dl> |
|
170 <a NAME="SimplifyChecker.run" ID="SimplifyChecker.run"></a> |
|
171 <h4>SimplifyChecker.run</h4> |
|
172 <b>run</b>(<i></i>) |
|
173 |
|
174 <p> |
|
175 Public method to check the given source against functions |
|
176 to be replaced by 'pathlib' equivalents. |
|
177 </p> |
|
178 <div align="right"><a href="#top">Up</a></div> |
|
179 <hr /> |
|
180 </body></html> |