|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.eradicate</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.Miscellaneous.eradicate</h1> |
|
10 |
|
11 <p> |
|
12 Removes commented-out Python code. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>__version__</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#Eradicator">Eradicator</a></td> |
|
25 <td>Eradicate comments.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 |
|
32 <tr> |
|
33 <td><a href="#main">main</a></td> |
|
34 <td>Main entry point.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <hr /> |
|
38 <hr /> |
|
39 <a NAME="Eradicator" ID="Eradicator"></a> |
|
40 <h2>Eradicator</h2> |
|
41 |
|
42 <p> |
|
43 Eradicate comments. |
|
44 </p> |
|
45 <h3>Derived from</h3> |
|
46 object |
|
47 <h3>Class Attributes</h3> |
|
48 |
|
49 <table> |
|
50 <tr><td>BRACKET_REGEX</td></tr><tr><td>CODE_INDICATORS</td></tr><tr><td>CODE_KEYWORDS</td></tr><tr><td>CODE_KEYWORDS_AGGR</td></tr><tr><td>CODING_COMMENT_REGEX</td></tr><tr><td>DEFAULT_WHITELIST</td></tr><tr><td>DEF_STATEMENT_REGEX</td></tr><tr><td>FOR_STATEMENT_REGEX</td></tr><tr><td>HASH_NUMBER</td></tr><tr><td>MULTILINE_ASSIGNMENT_REGEX</td></tr><tr><td>PARTIAL_DICTIONARY_REGEX</td></tr><tr><td>PRINT_RETURN_REGEX</td></tr><tr><td>WHITELIST_REGEX</td></tr><tr><td>WHITESPACE_HASH</td></tr><tr><td>WITH_STATEMENT_REGEX</td></tr> |
|
51 </table> |
|
52 <h3>Class Methods</h3> |
|
53 |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 |
|
59 <table> |
|
60 |
|
61 <tr> |
|
62 <td><a href="#Eradicator.comment_contains_code">comment_contains_code</a></td> |
|
63 <td>Return True comment contains code.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#Eradicator.commented_out_code_line_numbers">commented_out_code_line_numbers</a></td> |
|
67 <td>Yield line numbers of commented-out code.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#Eradicator.detect_encoding">detect_encoding</a></td> |
|
71 <td>Return file encoding.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#Eradicator.filter_commented_out_code">filter_commented_out_code</a></td> |
|
75 <td>Yield code with commented out code removed.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#Eradicator.fix_file">fix_file</a></td> |
|
79 <td>Run filter_commented_out_code() on file.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#Eradicator.multiline_case">multiline_case</a></td> |
|
83 <td>Return True if line is probably part of some multiline code.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#Eradicator.open_with_encoding">open_with_encoding</a></td> |
|
87 <td>Return opened file with a specific encoding.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#Eradicator.update_whitelist">update_whitelist</a></td> |
|
91 <td>Updates the whitelist.</td> |
|
92 </tr> |
|
93 </table> |
|
94 <h3>Static Methods</h3> |
|
95 |
|
96 <table> |
|
97 <tr><td>None</td></tr> |
|
98 </table> |
|
99 |
|
100 <a NAME="Eradicator.comment_contains_code" ID="Eradicator.comment_contains_code"></a> |
|
101 <h4>Eradicator.comment_contains_code</h4> |
|
102 <b>comment_contains_code</b>(<i>line, aggressive=True</i>) |
|
103 |
|
104 <p> |
|
105 Return True comment contains code. |
|
106 </p> |
|
107 <a NAME="Eradicator.commented_out_code_line_numbers" ID="Eradicator.commented_out_code_line_numbers"></a> |
|
108 <h4>Eradicator.commented_out_code_line_numbers</h4> |
|
109 <b>commented_out_code_line_numbers</b>(<i>source, aggressive=True</i>) |
|
110 |
|
111 <p> |
|
112 Yield line numbers of commented-out code. |
|
113 </p> |
|
114 <a NAME="Eradicator.detect_encoding" ID="Eradicator.detect_encoding"></a> |
|
115 <h4>Eradicator.detect_encoding</h4> |
|
116 <b>detect_encoding</b>(<i>filename</i>) |
|
117 |
|
118 <p> |
|
119 Return file encoding. |
|
120 </p> |
|
121 <a NAME="Eradicator.filter_commented_out_code" ID="Eradicator.filter_commented_out_code"></a> |
|
122 <h4>Eradicator.filter_commented_out_code</h4> |
|
123 <b>filter_commented_out_code</b>(<i>source, aggressive=True</i>) |
|
124 |
|
125 <p> |
|
126 Yield code with commented out code removed. |
|
127 </p> |
|
128 <a NAME="Eradicator.fix_file" ID="Eradicator.fix_file"></a> |
|
129 <h4>Eradicator.fix_file</h4> |
|
130 <b>fix_file</b>(<i>filename, args, standard_out</i>) |
|
131 |
|
132 <p> |
|
133 Run filter_commented_out_code() on file. |
|
134 </p> |
|
135 <a NAME="Eradicator.multiline_case" ID="Eradicator.multiline_case"></a> |
|
136 <h4>Eradicator.multiline_case</h4> |
|
137 <b>multiline_case</b>(<i>line, aggressive=True</i>) |
|
138 |
|
139 <p> |
|
140 Return True if line is probably part of some multiline code. |
|
141 </p> |
|
142 <a NAME="Eradicator.open_with_encoding" ID="Eradicator.open_with_encoding"></a> |
|
143 <h4>Eradicator.open_with_encoding</h4> |
|
144 <b>open_with_encoding</b>(<i>filename, encoding, mode='r'</i>) |
|
145 |
|
146 <p> |
|
147 Return opened file with a specific encoding. |
|
148 </p> |
|
149 <a NAME="Eradicator.update_whitelist" ID="Eradicator.update_whitelist"></a> |
|
150 <h4>Eradicator.update_whitelist</h4> |
|
151 <b>update_whitelist</b>(<i>new_whitelist, extend_default=True</i>) |
|
152 |
|
153 <p> |
|
154 Updates the whitelist. |
|
155 </p> |
|
156 <div align="right"><a href="#top">Up</a></div> |
|
157 <hr /> |
|
158 <hr /> |
|
159 <a NAME="main" ID="main"></a> |
|
160 <h2>main</h2> |
|
161 <b>main</b>(<i>argv, standard_out, standard_error</i>) |
|
162 |
|
163 <p> |
|
164 Main entry point. |
|
165 </p> |
|
166 <div align="right"><a href="#top">Up</a></div> |
|
167 <hr /> |
|
168 </body></html> |