16 |
16 |
17 a { color: #BA6D36; } |
17 a { color: #BA6D36; } |
18 |
18 |
19 </style> |
19 </style> |
20 </head> |
20 </head> |
21 <body><a NAME="top" ID="top"></a> |
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
22 <h1>eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer</h1> |
23 <h1>eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing a class to fix certain code style issues. |
26 Module implementing a class to fix certain code style issues. |
25 </p> |
27 </p> |
26 <h3>Global Attributes</h3> |
28 <h3>Global Attributes</h3> |
|
29 |
27 <table> |
30 <table> |
28 <tr><td>FixableCodeStyleIssues</td></tr> |
31 <tr><td>FixableCodeStyleIssues</td></tr> |
29 </table> |
32 </table> |
30 <h3>Classes</h3> |
33 <h3>Classes</h3> |
|
34 |
31 <table> |
35 <table> |
|
36 |
32 <tr> |
37 <tr> |
33 <td><a href="#CodeStyleFixer">CodeStyleFixer</a></td> |
38 <td><a href="#CodeStyleFixer">CodeStyleFixer</a></td> |
34 <td>Class implementing a fixer for certain code style issues.</td> |
39 <td>Class implementing a fixer for certain code style issues.</td> |
35 </tr><tr> |
40 </tr> |
|
41 <tr> |
36 <td><a href="#IndentationWrapper">IndentationWrapper</a></td> |
42 <td><a href="#IndentationWrapper">IndentationWrapper</a></td> |
37 <td>Class used by fixers dealing with indentation.</td> |
43 <td>Class used by fixers dealing with indentation.</td> |
38 </tr><tr> |
44 </tr> |
|
45 <tr> |
39 <td><a href="#LineShortener">LineShortener</a></td> |
46 <td><a href="#LineShortener">LineShortener</a></td> |
40 <td>Class used to shorten lines to a given maximum of characters.</td> |
47 <td>Class used to shorten lines to a given maximum of characters.</td> |
41 </tr><tr> |
48 </tr> |
|
49 <tr> |
42 <td><a href="#Reindenter">Reindenter</a></td> |
50 <td><a href="#Reindenter">Reindenter</a></td> |
43 <td>Class to reindent badly-indented code to uniformly use four-space indentation.</td> |
51 <td>Class to reindent badly-indented code to uniformly use four-space indentation.</td> |
44 </tr> |
52 </tr> |
45 </table> |
53 </table> |
46 <h3>Functions</h3> |
54 <h3>Functions</h3> |
|
55 |
47 <table> |
56 <table> |
48 <tr><td>None</td></tr> |
57 <tr><td>None</td></tr> |
49 </table> |
58 </table> |
50 <hr /><hr /> |
59 <hr /> |
|
60 <hr /> |
51 <a NAME="CodeStyleFixer" ID="CodeStyleFixer"></a> |
61 <a NAME="CodeStyleFixer" ID="CodeStyleFixer"></a> |
52 <h2>CodeStyleFixer</h2> |
62 <h2>CodeStyleFixer</h2> |
|
63 |
53 <p> |
64 <p> |
54 Class implementing a fixer for certain code style issues. |
65 Class implementing a fixer for certain code style issues. |
55 </p> |
66 </p> |
56 <h3>Derived from</h3> |
67 <h3>Derived from</h3> |
57 object |
68 object |
58 <h3>Class Attributes</h3> |
69 <h3>Class Attributes</h3> |
|
70 |
59 <table> |
71 <table> |
60 <tr><td>None</td></tr> |
72 <tr><td>None</td></tr> |
61 </table> |
73 </table> |
62 <h3>Class Methods</h3> |
74 <h3>Class Methods</h3> |
|
75 |
63 <table> |
76 <table> |
64 <tr><td>None</td></tr> |
77 <tr><td>None</td></tr> |
65 </table> |
78 </table> |
66 <h3>Methods</h3> |
79 <h3>Methods</h3> |
|
80 |
67 <table> |
81 <table> |
|
82 |
68 <tr> |
83 <tr> |
69 <td><a href="#CodeStyleFixer.__init__">CodeStyleFixer</a></td> |
84 <td><a href="#CodeStyleFixer.__init__">CodeStyleFixer</a></td> |
70 <td>Constructor</td> |
85 <td>Constructor</td> |
71 </tr><tr> |
86 </tr> |
|
87 <tr> |
72 <td><a href="#CodeStyleFixer.__codeMatch">__codeMatch</a></td> |
88 <td><a href="#CodeStyleFixer.__codeMatch">__codeMatch</a></td> |
73 <td>Private method to check, if the code should be fixed.</td> |
89 <td>Private method to check, if the code should be fixed.</td> |
74 </tr><tr> |
90 </tr> |
|
91 <tr> |
75 <td><a href="#CodeStyleFixer.__findLogical">__findLogical</a></td> |
92 <td><a href="#CodeStyleFixer.__findLogical">__findLogical</a></td> |
76 <td>Private method to extract the index of all the starts and ends of lines.</td> |
93 <td>Private method to extract the index of all the starts and ends of lines.</td> |
77 </tr><tr> |
94 </tr> |
|
95 <tr> |
78 <td><a href="#CodeStyleFixer.__fixBlankLinesBefore">__fixBlankLinesBefore</a></td> |
96 <td><a href="#CodeStyleFixer.__fixBlankLinesBefore">__fixBlankLinesBefore</a></td> |
79 <td>Private method to fix the need for blank lines before class, function and method definitions.</td> |
97 <td>Private method to fix the need for blank lines before class, function and method definitions.</td> |
80 </tr><tr> |
98 </tr> |
|
99 <tr> |
81 <td><a href="#CodeStyleFixer.__fixD111">__fixD111</a></td> |
100 <td><a href="#CodeStyleFixer.__fixD111">__fixD111</a></td> |
82 <td>Private method to fix docstring enclosed in wrong quotes.</td> |
101 <td>Private method to fix docstring enclosed in wrong quotes.</td> |
83 </tr><tr> |
102 </tr> |
|
103 <tr> |
84 <td><a href="#CodeStyleFixer.__fixD112">__fixD112</a></td> |
104 <td><a href="#CodeStyleFixer.__fixD112">__fixD112</a></td> |
85 <td>Private method to fix docstring 'r' or 'u' in leading quotes.</td> |
105 <td>Private method to fix docstring 'r' or 'u' in leading quotes.</td> |
86 </tr><tr> |
106 </tr> |
|
107 <tr> |
87 <td><a href="#CodeStyleFixer.__fixD121">__fixD121</a></td> |
108 <td><a href="#CodeStyleFixer.__fixD121">__fixD121</a></td> |
88 <td>Private method to fix a single line docstring on multiple lines.</td> |
109 <td>Private method to fix a single line docstring on multiple lines.</td> |
89 </tr><tr> |
110 </tr> |
|
111 <tr> |
90 <td><a href="#CodeStyleFixer.__fixD131">__fixD131</a></td> |
112 <td><a href="#CodeStyleFixer.__fixD131">__fixD131</a></td> |
91 <td>Private method to fix a docstring summary not ending with a period.</td> |
113 <td>Private method to fix a docstring summary not ending with a period.</td> |
92 </tr><tr> |
114 </tr> |
|
115 <tr> |
93 <td><a href="#CodeStyleFixer.__fixD141">__fixD141</a></td> |
116 <td><a href="#CodeStyleFixer.__fixD141">__fixD141</a></td> |
94 <td>Private method to fix a function/method docstring preceded by a blank line.</td> |
117 <td>Private method to fix a function/method docstring preceded by a blank line.</td> |
95 </tr><tr> |
118 </tr> |
|
119 <tr> |
96 <td><a href="#CodeStyleFixer.__fixD142">__fixD142</a></td> |
120 <td><a href="#CodeStyleFixer.__fixD142">__fixD142</a></td> |
97 <td>Private method to fix a class docstring not preceded by a blank line.</td> |
121 <td>Private method to fix a class docstring not preceded by a blank line.</td> |
98 </tr><tr> |
122 </tr> |
|
123 <tr> |
99 <td><a href="#CodeStyleFixer.__fixD143">__fixD143</a></td> |
124 <td><a href="#CodeStyleFixer.__fixD143">__fixD143</a></td> |
100 <td>Private method to fix a class docstring not followed by a blank line.</td> |
125 <td>Private method to fix a class docstring not followed by a blank line.</td> |
101 </tr><tr> |
126 </tr> |
|
127 <tr> |
102 <td><a href="#CodeStyleFixer.__fixD144">__fixD144</a></td> |
128 <td><a href="#CodeStyleFixer.__fixD144">__fixD144</a></td> |
103 <td>Private method to fix a docstring summary not followed by a blank line.</td> |
129 <td>Private method to fix a docstring summary not followed by a blank line.</td> |
104 </tr><tr> |
130 </tr> |
|
131 <tr> |
105 <td><a href="#CodeStyleFixer.__fixD145">__fixD145</a></td> |
132 <td><a href="#CodeStyleFixer.__fixD145">__fixD145</a></td> |
106 <td>Private method to fix the last paragraph of a multi-line docstring not followed by a blank line.</td> |
133 <td>Private method to fix the last paragraph of a multi-line docstring not followed by a blank line.</td> |
107 </tr><tr> |
134 </tr> |
|
135 <tr> |
108 <td><a href="#CodeStyleFixer.__fixD221">__fixD221</a></td> |
136 <td><a href="#CodeStyleFixer.__fixD221">__fixD221</a></td> |
109 <td>Private method to fix leading and trailing quotes of docstring not on separate lines.</td> |
137 <td>Private method to fix leading and trailing quotes of docstring not on separate lines.</td> |
110 </tr><tr> |
138 </tr> |
|
139 <tr> |
111 <td><a href="#CodeStyleFixer.__fixD242">__fixD242</a></td> |
140 <td><a href="#CodeStyleFixer.__fixD242">__fixD242</a></td> |
112 <td>Private method to fix a class or function/method docstring preceded by a blank line.</td> |
141 <td>Private method to fix a class or function/method docstring preceded by a blank line.</td> |
113 </tr><tr> |
142 </tr> |
|
143 <tr> |
114 <td><a href="#CodeStyleFixer.__fixD243">__fixD243</a></td> |
144 <td><a href="#CodeStyleFixer.__fixD243">__fixD243</a></td> |
115 <td>Private method to fix a class or function/method docstring followed by a blank line.</td> |
145 <td>Private method to fix a class or function/method docstring followed by a blank line.</td> |
116 </tr><tr> |
146 </tr> |
|
147 <tr> |
117 <td><a href="#CodeStyleFixer.__fixD247">__fixD247</a></td> |
148 <td><a href="#CodeStyleFixer.__fixD247">__fixD247</a></td> |
118 <td>Private method to fix a last paragraph of a docstring followed by a blank line.</td> |
149 <td>Private method to fix a last paragraph of a docstring followed by a blank line.</td> |
119 </tr><tr> |
150 </tr> |
|
151 <tr> |
120 <td><a href="#CodeStyleFixer.__fixE101">__fixE101</a></td> |
152 <td><a href="#CodeStyleFixer.__fixE101">__fixE101</a></td> |
121 <td>Private method to fix obsolete tab usage and indentation errors.</td> |
153 <td>Private method to fix obsolete tab usage and indentation errors.</td> |
122 </tr><tr> |
154 </tr> |
|
155 <tr> |
123 <td><a href="#CodeStyleFixer.__fixE121">__fixE121</a></td> |
156 <td><a href="#CodeStyleFixer.__fixE121">__fixE121</a></td> |
124 <td>Private method to fix the indentation of continuation lines and closing brackets.</td> |
157 <td>Private method to fix the indentation of continuation lines and closing brackets.</td> |
125 </tr><tr> |
158 </tr> |
|
159 <tr> |
126 <td><a href="#CodeStyleFixer.__fixE122">__fixE122</a></td> |
160 <td><a href="#CodeStyleFixer.__fixE122">__fixE122</a></td> |
127 <td>Private method to fix a missing indentation of continuation lines.</td> |
161 <td>Private method to fix a missing indentation of continuation lines.</td> |
128 </tr><tr> |
162 </tr> |
|
163 <tr> |
129 <td><a href="#CodeStyleFixer.__fixE123">__fixE123</a></td> |
164 <td><a href="#CodeStyleFixer.__fixE123">__fixE123</a></td> |
130 <td>Private method to fix the indentation of a closing bracket lines.</td> |
165 <td>Private method to fix the indentation of a closing bracket lines.</td> |
131 </tr><tr> |
166 </tr> |
|
167 <tr> |
132 <td><a href="#CodeStyleFixer.__fixE125">__fixE125</a></td> |
168 <td><a href="#CodeStyleFixer.__fixE125">__fixE125</a></td> |
133 <td>Private method to fix the indentation of continuation lines not distinguishable from next logical line.</td> |
169 <td>Private method to fix the indentation of continuation lines not distinguishable from next logical line.</td> |
134 </tr><tr> |
170 </tr> |
|
171 <tr> |
135 <td><a href="#CodeStyleFixer.__fixE126">__fixE126</a></td> |
172 <td><a href="#CodeStyleFixer.__fixE126">__fixE126</a></td> |
136 <td>Private method to fix over-indented/under-indented hanging indentation.</td> |
173 <td>Private method to fix over-indented/under-indented hanging indentation.</td> |
137 </tr><tr> |
174 </tr> |
|
175 <tr> |
138 <td><a href="#CodeStyleFixer.__fixE127">__fixE127</a></td> |
176 <td><a href="#CodeStyleFixer.__fixE127">__fixE127</a></td> |
139 <td>Private method to fix over/under indented lines.</td> |
177 <td>Private method to fix over/under indented lines.</td> |
140 </tr><tr> |
178 </tr> |
|
179 <tr> |
141 <td><a href="#CodeStyleFixer.__fixE201">__fixE201</a></td> |
180 <td><a href="#CodeStyleFixer.__fixE201">__fixE201</a></td> |
142 <td>Private method to fix extraneous whitespace.</td> |
181 <td>Private method to fix extraneous whitespace.</td> |
143 </tr><tr> |
182 </tr> |
|
183 <tr> |
144 <td><a href="#CodeStyleFixer.__fixE221">__fixE221</a></td> |
184 <td><a href="#CodeStyleFixer.__fixE221">__fixE221</a></td> |
145 <td>Private method to fix extraneous whitespace around operator or keyword.</td> |
185 <td>Private method to fix extraneous whitespace around operator or keyword.</td> |
146 </tr><tr> |
186 </tr> |
|
187 <tr> |
147 <td><a href="#CodeStyleFixer.__fixE225">__fixE225</a></td> |
188 <td><a href="#CodeStyleFixer.__fixE225">__fixE225</a></td> |
148 <td>Private method to fix extraneous whitespaces around operator.</td> |
189 <td>Private method to fix extraneous whitespaces around operator.</td> |
149 </tr><tr> |
190 </tr> |
|
191 <tr> |
150 <td><a href="#CodeStyleFixer.__fixE231">__fixE231</a></td> |
192 <td><a href="#CodeStyleFixer.__fixE231">__fixE231</a></td> |
151 <td>Private method to fix missing whitespace after ',;:'.</td> |
193 <td>Private method to fix missing whitespace after ',;:'.</td> |
152 </tr><tr> |
194 </tr> |
|
195 <tr> |
153 <td><a href="#CodeStyleFixer.__fixE251">__fixE251</a></td> |
196 <td><a href="#CodeStyleFixer.__fixE251">__fixE251</a></td> |
154 <td>Private method to fix extraneous whitespace around keyword and default parameter equals.</td> |
197 <td>Private method to fix extraneous whitespace around keyword and default parameter equals.</td> |
155 </tr><tr> |
198 </tr> |
|
199 <tr> |
156 <td><a href="#CodeStyleFixer.__fixE261">__fixE261</a></td> |
200 <td><a href="#CodeStyleFixer.__fixE261">__fixE261</a></td> |
157 <td>Private method to fix whitespace before or after inline comment.</td> |
201 <td>Private method to fix whitespace before or after inline comment.</td> |
158 </tr><tr> |
202 </tr> |
|
203 <tr> |
159 <td><a href="#CodeStyleFixer.__fixE304">__fixE304</a></td> |
204 <td><a href="#CodeStyleFixer.__fixE304">__fixE304</a></td> |
160 <td>Private method to fix superfluous blank lines after a function decorator.</td> |
205 <td>Private method to fix superfluous blank lines after a function decorator.</td> |
161 </tr><tr> |
206 </tr> |
|
207 <tr> |
162 <td><a href="#CodeStyleFixer.__fixE401">__fixE401</a></td> |
208 <td><a href="#CodeStyleFixer.__fixE401">__fixE401</a></td> |
163 <td>Private method to fix multiple imports on one line.</td> |
209 <td>Private method to fix multiple imports on one line.</td> |
164 </tr><tr> |
210 </tr> |
|
211 <tr> |
165 <td><a href="#CodeStyleFixer.__fixE501">__fixE501</a></td> |
212 <td><a href="#CodeStyleFixer.__fixE501">__fixE501</a></td> |
166 <td>Private method to fix the long lines by breaking them.</td> |
213 <td>Private method to fix the long lines by breaking them.</td> |
167 </tr><tr> |
214 </tr> |
|
215 <tr> |
168 <td><a href="#CodeStyleFixer.__fixE502">__fixE502</a></td> |
216 <td><a href="#CodeStyleFixer.__fixE502">__fixE502</a></td> |
169 <td>Private method to fix redundant backslash within brackets.</td> |
217 <td>Private method to fix redundant backslash within brackets.</td> |
170 </tr><tr> |
218 </tr> |
|
219 <tr> |
171 <td><a href="#CodeStyleFixer.__fixE701">__fixE701</a></td> |
220 <td><a href="#CodeStyleFixer.__fixE701">__fixE701</a></td> |
172 <td>Private method to fix colon-separated compound statements.</td> |
221 <td>Private method to fix colon-separated compound statements.</td> |
173 </tr><tr> |
222 </tr> |
|
223 <tr> |
174 <td><a href="#CodeStyleFixer.__fixE702">__fixE702</a></td> |
224 <td><a href="#CodeStyleFixer.__fixE702">__fixE702</a></td> |
175 <td>Private method to fix semicolon-separated compound statements.</td> |
225 <td>Private method to fix semicolon-separated compound statements.</td> |
176 </tr><tr> |
226 </tr> |
|
227 <tr> |
177 <td><a href="#CodeStyleFixer.__fixE711">__fixE711</a></td> |
228 <td><a href="#CodeStyleFixer.__fixE711">__fixE711</a></td> |
178 <td>Private method to fix comparison with None.</td> |
229 <td>Private method to fix comparison with None.</td> |
179 </tr><tr> |
230 </tr> |
|
231 <tr> |
180 <td><a href="#CodeStyleFixer.__fixN804">__fixN804</a></td> |
232 <td><a href="#CodeStyleFixer.__fixN804">__fixN804</a></td> |
181 <td>Private method to fix a wrong first argument of normal and class methods.</td> |
233 <td>Private method to fix a wrong first argument of normal and class methods.</td> |
182 </tr><tr> |
234 </tr> |
|
235 <tr> |
183 <td><a href="#CodeStyleFixer.__fixN806">__fixN806</a></td> |
236 <td><a href="#CodeStyleFixer.__fixN806">__fixN806</a></td> |
184 <td>Private method to fix a wrong first argument of static methods.</td> |
237 <td>Private method to fix a wrong first argument of static methods.</td> |
185 </tr><tr> |
238 </tr> |
|
239 <tr> |
186 <td><a href="#CodeStyleFixer.__fixReindent">__fixReindent</a></td> |
240 <td><a href="#CodeStyleFixer.__fixReindent">__fixReindent</a></td> |
187 <td>Private method to fix a badly indented line.</td> |
241 <td>Private method to fix a badly indented line.</td> |
188 </tr><tr> |
242 </tr> |
|
243 <tr> |
189 <td><a href="#CodeStyleFixer.__fixW291">__fixW291</a></td> |
244 <td><a href="#CodeStyleFixer.__fixW291">__fixW291</a></td> |
190 <td>Private method to fix trailing whitespace.</td> |
245 <td>Private method to fix trailing whitespace.</td> |
191 </tr><tr> |
246 </tr> |
|
247 <tr> |
192 <td><a href="#CodeStyleFixer.__fixW292">__fixW292</a></td> |
248 <td><a href="#CodeStyleFixer.__fixW292">__fixW292</a></td> |
193 <td>Private method to fix a missing newline at the end of file.</td> |
249 <td>Private method to fix a missing newline at the end of file.</td> |
194 </tr><tr> |
250 </tr> |
|
251 <tr> |
195 <td><a href="#CodeStyleFixer.__fixW391">__fixW391</a></td> |
252 <td><a href="#CodeStyleFixer.__fixW391">__fixW391</a></td> |
196 <td>Private method to fix trailing blank lines.</td> |
253 <td>Private method to fix trailing blank lines.</td> |
197 </tr><tr> |
254 </tr> |
|
255 <tr> |
198 <td><a href="#CodeStyleFixer.__fixW603">__fixW603</a></td> |
256 <td><a href="#CodeStyleFixer.__fixW603">__fixW603</a></td> |
199 <td>Private method to fix the not equal notation.</td> |
257 <td>Private method to fix the not equal notation.</td> |
200 </tr><tr> |
258 </tr> |
|
259 <tr> |
201 <td><a href="#CodeStyleFixer.__fixWhitespace">__fixWhitespace</a></td> |
260 <td><a href="#CodeStyleFixer.__fixWhitespace">__fixWhitespace</a></td> |
202 <td>Private method to correct whitespace at the given offset.</td> |
261 <td>Private method to correct whitespace at the given offset.</td> |
203 </tr><tr> |
262 </tr> |
|
263 <tr> |
204 <td><a href="#CodeStyleFixer.__getID">__getID</a></td> |
264 <td><a href="#CodeStyleFixer.__getID">__getID</a></td> |
205 <td>Private method to get the ID for a deferred fix.</td> |
265 <td>Private method to get the ID for a deferred fix.</td> |
206 </tr><tr> |
266 </tr> |
|
267 <tr> |
207 <td><a href="#CodeStyleFixer.__getIndent">__getIndent</a></td> |
268 <td><a href="#CodeStyleFixer.__getIndent">__getIndent</a></td> |
208 <td>Private method to get the indentation string.</td> |
269 <td>Private method to get the indentation string.</td> |
209 </tr><tr> |
270 </tr> |
|
271 <tr> |
210 <td><a href="#CodeStyleFixer.__getIndentWord">__getIndentWord</a></td> |
272 <td><a href="#CodeStyleFixer.__getIndentWord">__getIndentWord</a></td> |
211 <td>Private method to determine the indentation type.</td> |
273 <td>Private method to determine the indentation type.</td> |
212 </tr><tr> |
274 </tr> |
|
275 <tr> |
213 <td><a href="#CodeStyleFixer.__getLogical">__getLogical</a></td> |
276 <td><a href="#CodeStyleFixer.__getLogical">__getLogical</a></td> |
214 <td>Private method to get the logical line corresponding to the given position.</td> |
277 <td>Private method to get the logical line corresponding to the given position.</td> |
215 </tr><tr> |
278 </tr> |
|
279 <tr> |
216 <td><a href="#CodeStyleFixer.__multilineStringLines">__multilineStringLines</a></td> |
280 <td><a href="#CodeStyleFixer.__multilineStringLines">__multilineStringLines</a></td> |
217 <td>Private method to determine the line numbers that are within multi line strings and these which are part of a documentation string.</td> |
281 <td>Private method to determine the line numbers that are within multi line strings and these which are part of a documentation string.</td> |
218 </tr><tr> |
282 </tr> |
|
283 <tr> |
219 <td><a href="#CodeStyleFixer.finalize">finalize</a></td> |
284 <td><a href="#CodeStyleFixer.finalize">finalize</a></td> |
220 <td>Public method to apply all deferred fixes.</td> |
285 <td>Public method to apply all deferred fixes.</td> |
221 </tr><tr> |
286 </tr> |
|
287 <tr> |
222 <td><a href="#CodeStyleFixer.fixIssue">fixIssue</a></td> |
288 <td><a href="#CodeStyleFixer.fixIssue">fixIssue</a></td> |
223 <td>Public method to fix the fixable issues.</td> |
289 <td>Public method to fix the fixable issues.</td> |
224 </tr><tr> |
290 </tr> |
|
291 <tr> |
225 <td><a href="#CodeStyleFixer.mutualStartswith">mutualStartswith</a></td> |
292 <td><a href="#CodeStyleFixer.mutualStartswith">mutualStartswith</a></td> |
226 <td>Local helper method to compare the beginnings of two strings against each other.</td> |
293 <td>Local helper method to compare the beginnings of two strings against each other.</td> |
227 </tr><tr> |
294 </tr> |
|
295 <tr> |
228 <td><a href="#CodeStyleFixer.saveFile">saveFile</a></td> |
296 <td><a href="#CodeStyleFixer.saveFile">saveFile</a></td> |
229 <td>Public method to save the modified file.</td> |
297 <td>Public method to save the modified file.</td> |
230 </tr> |
298 </tr> |
231 </table> |
299 </table> |
232 <h3>Static Methods</h3> |
300 <h3>Static Methods</h3> |
|
301 |
233 <table> |
302 <table> |
234 <tr><td>None</td></tr> |
303 <tr><td>None</td></tr> |
235 </table> |
304 </table> |
|
305 |
236 <a NAME="CodeStyleFixer.__init__" ID="CodeStyleFixer.__init__"></a> |
306 <a NAME="CodeStyleFixer.__init__" ID="CodeStyleFixer.__init__"></a> |
237 <h4>CodeStyleFixer (Constructor)</h4> |
307 <h4>CodeStyleFixer (Constructor)</h4> |
238 <b>CodeStyleFixer</b>(<i>filename, sourceLines, fixCodes, noFixCodes, maxLineLength, blankLines, inPlace, eol, backup=False</i>) |
308 <b>CodeStyleFixer</b>(<i>filename, sourceLines, fixCodes, noFixCodes, maxLineLength, blankLines, inPlace, eol, backup=False</i>) |
|
309 |
239 <p> |
310 <p> |
240 Constructor |
311 Constructor |
241 </p><dl> |
312 </p> |
|
313 <dl> |
|
314 |
242 <dt><i>filename</i> (str)</dt> |
315 <dt><i>filename</i> (str)</dt> |
243 <dd> |
316 <dd> |
244 name of the file to be fixed |
317 name of the file to be fixed |
245 </dd><dt><i>sourceLines</i> (list of str)</dt> |
318 </dd> |
|
319 <dt><i>sourceLines</i> (list of str)</dt> |
246 <dd> |
320 <dd> |
247 list of source lines including eol marker |
321 list of source lines including eol marker |
248 </dd><dt><i>fixCodes</i> (str)</dt> |
322 </dd> |
|
323 <dt><i>fixCodes</i> (str)</dt> |
249 <dd> |
324 <dd> |
250 list of codes to be fixed as a comma separated |
325 list of codes to be fixed as a comma separated |
251 string |
326 string |
252 </dd><dt><i>noFixCodes</i> (str)</dt> |
327 </dd> |
|
328 <dt><i>noFixCodes</i> (str)</dt> |
253 <dd> |
329 <dd> |
254 list of codes not to be fixed as a comma |
330 list of codes not to be fixed as a comma |
255 separated string |
331 separated string |
256 </dd><dt><i>maxLineLength</i> (int)</dt> |
332 </dd> |
|
333 <dt><i>maxLineLength</i> (int)</dt> |
257 <dd> |
334 <dd> |
258 maximum allowed line length |
335 maximum allowed line length |
259 </dd><dt><i>blankLines</i> (tuple of (int, int))</dt> |
336 </dd> |
|
337 <dt><i>blankLines</i> (tuple of (int, int))</dt> |
260 <dd> |
338 <dd> |
261 tuple containg the number of blank lines before |
339 tuple containg the number of blank lines before |
262 a top level class or function and before a method or nested class |
340 a top level class or function and before a method or nested class |
263 or function |
341 or function |
264 </dd><dt><i>inPlace</i> (bool)</dt> |
342 </dd> |
|
343 <dt><i>inPlace</i> (bool)</dt> |
265 <dd> |
344 <dd> |
266 flag indicating to modify the file in place |
345 flag indicating to modify the file in place |
267 </dd><dt><i>eol</i> (str)</dt> |
346 </dd> |
|
347 <dt><i>eol</i> (str)</dt> |
268 <dd> |
348 <dd> |
269 end of line character(s) |
349 end of line character(s) |
270 </dd><dt><i>backup</i> (bool)</dt> |
350 </dd> |
|
351 <dt><i>backup</i> (bool)</dt> |
271 <dd> |
352 <dd> |
272 flag indicating to create a backup before fixing |
353 flag indicating to create a backup before fixing |
273 anything |
354 anything |
274 </dd> |
355 </dd> |
275 </dl><a NAME="CodeStyleFixer.__codeMatch" ID="CodeStyleFixer.__codeMatch"></a> |
356 </dl> |
|
357 <a NAME="CodeStyleFixer.__codeMatch" ID="CodeStyleFixer.__codeMatch"></a> |
276 <h4>CodeStyleFixer.__codeMatch</h4> |
358 <h4>CodeStyleFixer.__codeMatch</h4> |
277 <b>__codeMatch</b>(<i>code</i>) |
359 <b>__codeMatch</b>(<i>code</i>) |
|
360 |
278 <p> |
361 <p> |
279 Private method to check, if the code should be fixed. |
362 Private method to check, if the code should be fixed. |
280 </p><dl> |
363 </p> |
|
364 <dl> |
|
365 |
281 <dt><i>code</i></dt> |
366 <dt><i>code</i></dt> |
282 <dd> |
367 <dd> |
283 to check (string) |
368 to check (string) |
284 </dd> |
369 </dd> |
285 </dl><dl> |
370 </dl> |
|
371 <dl> |
286 <dt>Returns:</dt> |
372 <dt>Returns:</dt> |
287 <dd> |
373 <dd> |
288 flag indicating it should be fixed (boolean) |
374 flag indicating it should be fixed (boolean) |
289 </dd> |
375 </dd> |
290 </dl><a NAME="CodeStyleFixer.__findLogical" ID="CodeStyleFixer.__findLogical"></a> |
376 </dl> |
|
377 <a NAME="CodeStyleFixer.__findLogical" ID="CodeStyleFixer.__findLogical"></a> |
291 <h4>CodeStyleFixer.__findLogical</h4> |
378 <h4>CodeStyleFixer.__findLogical</h4> |
292 <b>__findLogical</b>(<i></i>) |
379 <b>__findLogical</b>(<i></i>) |
|
380 |
293 <p> |
381 <p> |
294 Private method to extract the index of all the starts and ends of |
382 Private method to extract the index of all the starts and ends of |
295 lines. |
383 lines. |
296 </p><dl> |
384 </p> |
|
385 <dl> |
297 <dt>Returns:</dt> |
386 <dt>Returns:</dt> |
298 <dd> |
387 <dd> |
299 tuple containing two lists of integer with start and end tuples |
388 tuple containing two lists of integer with start and end tuples |
300 of lines |
389 of lines |
301 </dd> |
390 </dd> |
302 </dl><a NAME="CodeStyleFixer.__fixBlankLinesBefore" ID="CodeStyleFixer.__fixBlankLinesBefore"></a> |
391 </dl> |
|
392 <a NAME="CodeStyleFixer.__fixBlankLinesBefore" ID="CodeStyleFixer.__fixBlankLinesBefore"></a> |
303 <h4>CodeStyleFixer.__fixBlankLinesBefore</h4> |
393 <h4>CodeStyleFixer.__fixBlankLinesBefore</h4> |
304 <b>__fixBlankLinesBefore</b>(<i>code, line, pos, apply=False</i>) |
394 <b>__fixBlankLinesBefore</b>(<i>code, line, pos, apply=False</i>) |
|
395 |
305 <p> |
396 <p> |
306 Private method to fix the need for blank lines before class, function |
397 Private method to fix the need for blank lines before class, function |
307 and method definitions. |
398 and method definitions. |
308 </p><p> |
399 </p> |
|
400 <p> |
309 Codes: E301, E302, E303, E305, E306, E307, E308 |
401 Codes: E301, E302, E303, E305, E306, E307, E308 |
310 </p><dl> |
402 </p> |
311 <dt><i>code</i></dt> |
403 <dl> |
312 <dd> |
404 |
313 code of the issue (string) |
405 <dt><i>code</i></dt> |
314 </dd><dt><i>line</i></dt> |
406 <dd> |
315 <dd> |
407 code of the issue (string) |
316 line number of the issue (integer) |
408 </dd> |
317 </dd><dt><i>pos</i></dt> |
409 <dt><i>line</i></dt> |
318 <dd> |
410 <dd> |
319 position inside line (integer) |
411 line number of the issue (integer) |
320 </dd><dt><i>apply=</i></dt> |
412 </dd> |
|
413 <dt><i>pos</i></dt> |
|
414 <dd> |
|
415 position inside line (integer) |
|
416 </dd> |
|
417 <dt><i>apply=</i></dt> |
321 <dd> |
418 <dd> |
322 flag indicating, that the fix should be applied |
419 flag indicating, that the fix should be applied |
323 (boolean) |
420 (boolean) |
324 </dd> |
421 </dd> |
325 </dl><dl> |
422 </dl> |
326 <dt>Returns:</dt> |
423 <dl> |
327 <dd> |
424 <dt>Returns:</dt> |
328 value indicating an applied/deferred fix (-1, 0, 1), |
425 <dd> |
329 a message for the fix (string) and an ID for a deferred |
426 value indicating an applied/deferred fix (-1, 0, 1), |
330 fix (integer) |
427 a message for the fix (string) and an ID for a deferred |
331 </dd> |
428 fix (integer) |
332 </dl><a NAME="CodeStyleFixer.__fixD111" ID="CodeStyleFixer.__fixD111"></a> |
429 </dd> |
|
430 </dl> |
|
431 <a NAME="CodeStyleFixer.__fixD111" ID="CodeStyleFixer.__fixD111"></a> |
333 <h4>CodeStyleFixer.__fixD111</h4> |
432 <h4>CodeStyleFixer.__fixD111</h4> |
334 <b>__fixD111</b>(<i>code, line, pos</i>) |
433 <b>__fixD111</b>(<i>code, line, pos</i>) |
|
434 |
335 <p> |
435 <p> |
336 Private method to fix docstring enclosed in wrong quotes. |
436 Private method to fix docstring enclosed in wrong quotes. |
337 </p><p> |
437 </p> |
|
438 <p> |
338 Codes: D111 |
439 Codes: D111 |
339 </p><dl> |
440 </p> |
340 <dt><i>code</i></dt> |
441 <dl> |
341 <dd> |
442 |
342 code of the issue (string) |
443 <dt><i>code</i></dt> |
343 </dd><dt><i>line</i></dt> |
444 <dd> |
344 <dd> |
445 code of the issue (string) |
345 line number of the issue (integer) |
446 </dd> |
346 </dd><dt><i>pos</i></dt> |
447 <dt><i>line</i></dt> |
347 <dd> |
448 <dd> |
348 position inside line (integer) |
449 line number of the issue (integer) |
349 </dd> |
450 </dd> |
350 </dl><dl> |
451 <dt><i>pos</i></dt> |
351 <dt>Returns:</dt> |
452 <dd> |
352 <dd> |
453 position inside line (integer) |
353 value indicating an applied/deferred fix (-1, 0, 1), |
454 </dd> |
354 a message for the fix (string) and an ID for a deferred |
455 </dl> |
355 fix (integer) |
456 <dl> |
356 </dd> |
457 <dt>Returns:</dt> |
357 </dl><a NAME="CodeStyleFixer.__fixD112" ID="CodeStyleFixer.__fixD112"></a> |
458 <dd> |
|
459 value indicating an applied/deferred fix (-1, 0, 1), |
|
460 a message for the fix (string) and an ID for a deferred |
|
461 fix (integer) |
|
462 </dd> |
|
463 </dl> |
|
464 <a NAME="CodeStyleFixer.__fixD112" ID="CodeStyleFixer.__fixD112"></a> |
358 <h4>CodeStyleFixer.__fixD112</h4> |
465 <h4>CodeStyleFixer.__fixD112</h4> |
359 <b>__fixD112</b>(<i>code, line, pos</i>) |
466 <b>__fixD112</b>(<i>code, line, pos</i>) |
|
467 |
360 <p> |
468 <p> |
361 Private method to fix docstring 'r' or 'u' in leading quotes. |
469 Private method to fix docstring 'r' or 'u' in leading quotes. |
362 </p><p> |
470 </p> |
|
471 <p> |
363 Codes: D112, D113 |
472 Codes: D112, D113 |
364 </p><dl> |
473 </p> |
365 <dt><i>code</i></dt> |
474 <dl> |
366 <dd> |
475 |
367 code of the issue (string) |
476 <dt><i>code</i></dt> |
368 </dd><dt><i>line</i></dt> |
477 <dd> |
369 <dd> |
478 code of the issue (string) |
370 line number of the issue (integer) |
479 </dd> |
371 </dd><dt><i>pos</i></dt> |
480 <dt><i>line</i></dt> |
372 <dd> |
481 <dd> |
373 position inside line (integer) |
482 line number of the issue (integer) |
374 </dd> |
483 </dd> |
375 </dl><dl> |
484 <dt><i>pos</i></dt> |
376 <dt>Returns:</dt> |
485 <dd> |
377 <dd> |
486 position inside line (integer) |
378 value indicating an applied/deferred fix (-1, 0, 1), |
487 </dd> |
379 a message for the fix (string) and an ID for a deferred |
488 </dl> |
380 fix (integer) |
489 <dl> |
381 </dd> |
490 <dt>Returns:</dt> |
382 </dl><a NAME="CodeStyleFixer.__fixD121" ID="CodeStyleFixer.__fixD121"></a> |
491 <dd> |
|
492 value indicating an applied/deferred fix (-1, 0, 1), |
|
493 a message for the fix (string) and an ID for a deferred |
|
494 fix (integer) |
|
495 </dd> |
|
496 </dl> |
|
497 <a NAME="CodeStyleFixer.__fixD121" ID="CodeStyleFixer.__fixD121"></a> |
383 <h4>CodeStyleFixer.__fixD121</h4> |
498 <h4>CodeStyleFixer.__fixD121</h4> |
384 <b>__fixD121</b>(<i>code, line, pos, apply=False</i>) |
499 <b>__fixD121</b>(<i>code, line, pos, apply=False</i>) |
|
500 |
385 <p> |
501 <p> |
386 Private method to fix a single line docstring on multiple lines. |
502 Private method to fix a single line docstring on multiple lines. |
387 </p><p> |
503 </p> |
|
504 <p> |
388 Codes: D121 |
505 Codes: D121 |
389 </p><dl> |
506 </p> |
390 <dt><i>code</i></dt> |
507 <dl> |
391 <dd> |
508 |
392 code of the issue (string) |
509 <dt><i>code</i></dt> |
393 </dd><dt><i>line</i></dt> |
510 <dd> |
394 <dd> |
511 code of the issue (string) |
395 line number of the issue (integer) |
512 </dd> |
396 </dd><dt><i>pos</i></dt> |
513 <dt><i>line</i></dt> |
397 <dd> |
514 <dd> |
398 position inside line (integer) |
515 line number of the issue (integer) |
399 </dd><dt><i>apply=</i></dt> |
516 </dd> |
|
517 <dt><i>pos</i></dt> |
|
518 <dd> |
|
519 position inside line (integer) |
|
520 </dd> |
|
521 <dt><i>apply=</i></dt> |
400 <dd> |
522 <dd> |
401 flag indicating, that the fix should be applied |
523 flag indicating, that the fix should be applied |
402 (boolean) |
524 (boolean) |
403 </dd> |
525 </dd> |
404 </dl><dl> |
526 </dl> |
405 <dt>Returns:</dt> |
527 <dl> |
406 <dd> |
528 <dt>Returns:</dt> |
407 value indicating an applied/deferred fix (-1, 0, 1), |
529 <dd> |
408 a message for the fix (string) and an ID for a deferred |
530 value indicating an applied/deferred fix (-1, 0, 1), |
409 fix (integer) |
531 a message for the fix (string) and an ID for a deferred |
410 </dd> |
532 fix (integer) |
411 </dl><a NAME="CodeStyleFixer.__fixD131" ID="CodeStyleFixer.__fixD131"></a> |
533 </dd> |
|
534 </dl> |
|
535 <a NAME="CodeStyleFixer.__fixD131" ID="CodeStyleFixer.__fixD131"></a> |
412 <h4>CodeStyleFixer.__fixD131</h4> |
536 <h4>CodeStyleFixer.__fixD131</h4> |
413 <b>__fixD131</b>(<i>code, line, pos</i>) |
537 <b>__fixD131</b>(<i>code, line, pos</i>) |
|
538 |
414 <p> |
539 <p> |
415 Private method to fix a docstring summary not ending with a |
540 Private method to fix a docstring summary not ending with a |
416 period. |
541 period. |
417 </p><p> |
542 </p> |
|
543 <p> |
418 Codes: D131 |
544 Codes: D131 |
419 </p><dl> |
545 </p> |
420 <dt><i>code</i></dt> |
546 <dl> |
421 <dd> |
547 |
422 code of the issue (string) |
548 <dt><i>code</i></dt> |
423 </dd><dt><i>line</i></dt> |
549 <dd> |
424 <dd> |
550 code of the issue (string) |
425 line number of the issue (integer) |
551 </dd> |
426 </dd><dt><i>pos</i></dt> |
552 <dt><i>line</i></dt> |
427 <dd> |
553 <dd> |
428 position inside line (integer) |
554 line number of the issue (integer) |
429 </dd> |
555 </dd> |
430 </dl><dl> |
556 <dt><i>pos</i></dt> |
431 <dt>Returns:</dt> |
557 <dd> |
432 <dd> |
558 position inside line (integer) |
433 value indicating an applied/deferred fix (-1, 0, 1), |
559 </dd> |
434 a message for the fix (string) and an ID for a deferred |
560 </dl> |
435 fix (integer) |
561 <dl> |
436 </dd> |
562 <dt>Returns:</dt> |
437 </dl><a NAME="CodeStyleFixer.__fixD141" ID="CodeStyleFixer.__fixD141"></a> |
563 <dd> |
|
564 value indicating an applied/deferred fix (-1, 0, 1), |
|
565 a message for the fix (string) and an ID for a deferred |
|
566 fix (integer) |
|
567 </dd> |
|
568 </dl> |
|
569 <a NAME="CodeStyleFixer.__fixD141" ID="CodeStyleFixer.__fixD141"></a> |
438 <h4>CodeStyleFixer.__fixD141</h4> |
570 <h4>CodeStyleFixer.__fixD141</h4> |
439 <b>__fixD141</b>(<i>code, line, pos, apply=False</i>) |
571 <b>__fixD141</b>(<i>code, line, pos, apply=False</i>) |
|
572 |
440 <p> |
573 <p> |
441 Private method to fix a function/method docstring preceded by a |
574 Private method to fix a function/method docstring preceded by a |
442 blank line. |
575 blank line. |
443 </p><p> |
576 </p> |
|
577 <p> |
444 Codes: D141 |
578 Codes: D141 |
445 </p><dl> |
579 </p> |
446 <dt><i>code</i></dt> |
580 <dl> |
447 <dd> |
581 |
448 code of the issue (string) |
582 <dt><i>code</i></dt> |
449 </dd><dt><i>line</i></dt> |
583 <dd> |
450 <dd> |
584 code of the issue (string) |
451 line number of the issue (integer) |
585 </dd> |
452 </dd><dt><i>pos</i></dt> |
586 <dt><i>line</i></dt> |
453 <dd> |
587 <dd> |
454 position inside line (integer) |
588 line number of the issue (integer) |
455 </dd><dt><i>apply=</i></dt> |
589 </dd> |
|
590 <dt><i>pos</i></dt> |
|
591 <dd> |
|
592 position inside line (integer) |
|
593 </dd> |
|
594 <dt><i>apply=</i></dt> |
456 <dd> |
595 <dd> |
457 flag indicating, that the fix should be applied |
596 flag indicating, that the fix should be applied |
458 (boolean) |
597 (boolean) |
459 </dd> |
598 </dd> |
460 </dl><dl> |
599 </dl> |
461 <dt>Returns:</dt> |
600 <dl> |
462 <dd> |
601 <dt>Returns:</dt> |
463 value indicating an applied/deferred fix (-1, 0, 1), |
602 <dd> |
464 a message for the fix (string) and an ID for a deferred |
603 value indicating an applied/deferred fix (-1, 0, 1), |
465 fix (integer) |
604 a message for the fix (string) and an ID for a deferred |
466 </dd> |
605 fix (integer) |
467 </dl><a NAME="CodeStyleFixer.__fixD142" ID="CodeStyleFixer.__fixD142"></a> |
606 </dd> |
|
607 </dl> |
|
608 <a NAME="CodeStyleFixer.__fixD142" ID="CodeStyleFixer.__fixD142"></a> |
468 <h4>CodeStyleFixer.__fixD142</h4> |
609 <h4>CodeStyleFixer.__fixD142</h4> |
469 <b>__fixD142</b>(<i>code, line, pos, apply=False</i>) |
610 <b>__fixD142</b>(<i>code, line, pos, apply=False</i>) |
|
611 |
470 <p> |
612 <p> |
471 Private method to fix a class docstring not preceded by a |
613 Private method to fix a class docstring not preceded by a |
472 blank line. |
614 blank line. |
473 </p><p> |
615 </p> |
|
616 <p> |
474 Codes: D142 |
617 Codes: D142 |
475 </p><dl> |
618 </p> |
476 <dt><i>code</i></dt> |
619 <dl> |
477 <dd> |
620 |
478 code of the issue (string) |
621 <dt><i>code</i></dt> |
479 </dd><dt><i>line</i></dt> |
622 <dd> |
480 <dd> |
623 code of the issue (string) |
481 line number of the issue (integer) |
624 </dd> |
482 </dd><dt><i>pos</i></dt> |
625 <dt><i>line</i></dt> |
483 <dd> |
626 <dd> |
484 position inside line (integer) |
627 line number of the issue (integer) |
485 </dd><dt><i>apply=</i></dt> |
628 </dd> |
|
629 <dt><i>pos</i></dt> |
|
630 <dd> |
|
631 position inside line (integer) |
|
632 </dd> |
|
633 <dt><i>apply=</i></dt> |
486 <dd> |
634 <dd> |
487 flag indicating, that the fix should be applied |
635 flag indicating, that the fix should be applied |
488 (boolean) |
636 (boolean) |
489 </dd> |
637 </dd> |
490 </dl><dl> |
638 </dl> |
491 <dt>Returns:</dt> |
639 <dl> |
492 <dd> |
640 <dt>Returns:</dt> |
493 value indicating an applied/deferred fix (-1, 0, 1), |
641 <dd> |
494 a message for the fix (string) and an ID for a deferred |
642 value indicating an applied/deferred fix (-1, 0, 1), |
495 fix (integer) |
643 a message for the fix (string) and an ID for a deferred |
496 </dd> |
644 fix (integer) |
497 </dl><a NAME="CodeStyleFixer.__fixD143" ID="CodeStyleFixer.__fixD143"></a> |
645 </dd> |
|
646 </dl> |
|
647 <a NAME="CodeStyleFixer.__fixD143" ID="CodeStyleFixer.__fixD143"></a> |
498 <h4>CodeStyleFixer.__fixD143</h4> |
648 <h4>CodeStyleFixer.__fixD143</h4> |
499 <b>__fixD143</b>(<i>code, line, pos, apply=False</i>) |
649 <b>__fixD143</b>(<i>code, line, pos, apply=False</i>) |
|
650 |
500 <p> |
651 <p> |
501 Private method to fix a class docstring not followed by a |
652 Private method to fix a class docstring not followed by a |
502 blank line. |
653 blank line. |
503 </p><p> |
654 </p> |
|
655 <p> |
504 Codes: D143 |
656 Codes: D143 |
505 </p><dl> |
657 </p> |
506 <dt><i>code</i></dt> |
658 <dl> |
507 <dd> |
659 |
508 code of the issue (string) |
660 <dt><i>code</i></dt> |
509 </dd><dt><i>line</i></dt> |
661 <dd> |
510 <dd> |
662 code of the issue (string) |
511 line number of the issue (integer) |
663 </dd> |
512 </dd><dt><i>pos</i></dt> |
664 <dt><i>line</i></dt> |
513 <dd> |
665 <dd> |
514 position inside line (integer) |
666 line number of the issue (integer) |
515 </dd><dt><i>apply=</i></dt> |
667 </dd> |
|
668 <dt><i>pos</i></dt> |
|
669 <dd> |
|
670 position inside line (integer) |
|
671 </dd> |
|
672 <dt><i>apply=</i></dt> |
516 <dd> |
673 <dd> |
517 flag indicating, that the fix should be applied |
674 flag indicating, that the fix should be applied |
518 (boolean) |
675 (boolean) |
519 </dd> |
676 </dd> |
520 </dl><dl> |
677 </dl> |
521 <dt>Returns:</dt> |
678 <dl> |
522 <dd> |
679 <dt>Returns:</dt> |
523 value indicating an applied/deferred fix (-1, 0, 1), |
680 <dd> |
524 a message for the fix (string) and an ID for a deferred |
681 value indicating an applied/deferred fix (-1, 0, 1), |
525 fix (integer) |
682 a message for the fix (string) and an ID for a deferred |
526 </dd> |
683 fix (integer) |
527 </dl><a NAME="CodeStyleFixer.__fixD144" ID="CodeStyleFixer.__fixD144"></a> |
684 </dd> |
|
685 </dl> |
|
686 <a NAME="CodeStyleFixer.__fixD144" ID="CodeStyleFixer.__fixD144"></a> |
528 <h4>CodeStyleFixer.__fixD144</h4> |
687 <h4>CodeStyleFixer.__fixD144</h4> |
529 <b>__fixD144</b>(<i>code, line, pos, apply=False</i>) |
688 <b>__fixD144</b>(<i>code, line, pos, apply=False</i>) |
|
689 |
530 <p> |
690 <p> |
531 Private method to fix a docstring summary not followed by a |
691 Private method to fix a docstring summary not followed by a |
532 blank line. |
692 blank line. |
533 </p><p> |
693 </p> |
|
694 <p> |
534 Codes: D144 |
695 Codes: D144 |
535 </p><dl> |
696 </p> |
536 <dt><i>code</i></dt> |
697 <dl> |
537 <dd> |
698 |
538 code of the issue (string) |
699 <dt><i>code</i></dt> |
539 </dd><dt><i>line</i></dt> |
700 <dd> |
540 <dd> |
701 code of the issue (string) |
541 line number of the issue (integer) |
702 </dd> |
542 </dd><dt><i>pos</i></dt> |
703 <dt><i>line</i></dt> |
543 <dd> |
704 <dd> |
544 position inside line (integer) |
705 line number of the issue (integer) |
545 </dd><dt><i>apply=</i></dt> |
706 </dd> |
|
707 <dt><i>pos</i></dt> |
|
708 <dd> |
|
709 position inside line (integer) |
|
710 </dd> |
|
711 <dt><i>apply=</i></dt> |
546 <dd> |
712 <dd> |
547 flag indicating, that the fix should be applied |
713 flag indicating, that the fix should be applied |
548 (boolean) |
714 (boolean) |
549 </dd> |
715 </dd> |
550 </dl><dl> |
716 </dl> |
551 <dt>Returns:</dt> |
717 <dl> |
552 <dd> |
718 <dt>Returns:</dt> |
553 value indicating an applied/deferred fix (-1, 0, 1), |
719 <dd> |
554 a message for the fix (string) and an ID for a deferred |
720 value indicating an applied/deferred fix (-1, 0, 1), |
555 fix (integer) |
721 a message for the fix (string) and an ID for a deferred |
556 </dd> |
722 fix (integer) |
557 </dl><a NAME="CodeStyleFixer.__fixD145" ID="CodeStyleFixer.__fixD145"></a> |
723 </dd> |
|
724 </dl> |
|
725 <a NAME="CodeStyleFixer.__fixD145" ID="CodeStyleFixer.__fixD145"></a> |
558 <h4>CodeStyleFixer.__fixD145</h4> |
726 <h4>CodeStyleFixer.__fixD145</h4> |
559 <b>__fixD145</b>(<i>code, line, pos, apply=False</i>) |
727 <b>__fixD145</b>(<i>code, line, pos, apply=False</i>) |
|
728 |
560 <p> |
729 <p> |
561 Private method to fix the last paragraph of a multi-line docstring |
730 Private method to fix the last paragraph of a multi-line docstring |
562 not followed by a blank line. |
731 not followed by a blank line. |
563 </p><p> |
732 </p> |
|
733 <p> |
564 Codes: D143 |
734 Codes: D143 |
565 </p><dl> |
735 </p> |
566 <dt><i>code</i></dt> |
736 <dl> |
567 <dd> |
737 |
568 code of the issue (string) |
738 <dt><i>code</i></dt> |
569 </dd><dt><i>line</i></dt> |
739 <dd> |
570 <dd> |
740 code of the issue (string) |
571 line number of the issue (integer) |
741 </dd> |
572 </dd><dt><i>pos</i></dt> |
742 <dt><i>line</i></dt> |
573 <dd> |
743 <dd> |
574 position inside line (integer) |
744 line number of the issue (integer) |
575 </dd><dt><i>apply=</i></dt> |
745 </dd> |
|
746 <dt><i>pos</i></dt> |
|
747 <dd> |
|
748 position inside line (integer) |
|
749 </dd> |
|
750 <dt><i>apply=</i></dt> |
576 <dd> |
751 <dd> |
577 flag indicating, that the fix should be applied |
752 flag indicating, that the fix should be applied |
578 (boolean) |
753 (boolean) |
579 </dd> |
754 </dd> |
580 </dl><dl> |
755 </dl> |
581 <dt>Returns:</dt> |
756 <dl> |
582 <dd> |
757 <dt>Returns:</dt> |
583 value indicating an applied/deferred fix (-1, 0, 1), |
758 <dd> |
584 a message for the fix (string) and an ID for a deferred |
759 value indicating an applied/deferred fix (-1, 0, 1), |
585 fix (integer) |
760 a message for the fix (string) and an ID for a deferred |
586 </dd> |
761 fix (integer) |
587 </dl><a NAME="CodeStyleFixer.__fixD221" ID="CodeStyleFixer.__fixD221"></a> |
762 </dd> |
|
763 </dl> |
|
764 <a NAME="CodeStyleFixer.__fixD221" ID="CodeStyleFixer.__fixD221"></a> |
588 <h4>CodeStyleFixer.__fixD221</h4> |
765 <h4>CodeStyleFixer.__fixD221</h4> |
589 <b>__fixD221</b>(<i>code, line, pos, apply=False</i>) |
766 <b>__fixD221</b>(<i>code, line, pos, apply=False</i>) |
|
767 |
590 <p> |
768 <p> |
591 Private method to fix leading and trailing quotes of docstring |
769 Private method to fix leading and trailing quotes of docstring |
592 not on separate lines. |
770 not on separate lines. |
593 </p><p> |
771 </p> |
|
772 <p> |
594 Codes: D221, D222 |
773 Codes: D221, D222 |
595 </p><dl> |
774 </p> |
596 <dt><i>code</i></dt> |
775 <dl> |
597 <dd> |
776 |
598 code of the issue (string) |
777 <dt><i>code</i></dt> |
599 </dd><dt><i>line</i></dt> |
778 <dd> |
600 <dd> |
779 code of the issue (string) |
601 line number of the issue (integer) |
780 </dd> |
602 </dd><dt><i>pos</i></dt> |
781 <dt><i>line</i></dt> |
603 <dd> |
782 <dd> |
604 position inside line (integer) |
783 line number of the issue (integer) |
605 </dd><dt><i>apply=</i></dt> |
784 </dd> |
|
785 <dt><i>pos</i></dt> |
|
786 <dd> |
|
787 position inside line (integer) |
|
788 </dd> |
|
789 <dt><i>apply=</i></dt> |
606 <dd> |
790 <dd> |
607 flag indicating, that the fix should be applied |
791 flag indicating, that the fix should be applied |
608 (boolean) |
792 (boolean) |
609 </dd> |
793 </dd> |
610 </dl><dl> |
794 </dl> |
611 <dt>Returns:</dt> |
795 <dl> |
612 <dd> |
796 <dt>Returns:</dt> |
613 value indicating an applied/deferred fix (-1, 0, 1), |
797 <dd> |
614 a message for the fix (string) and an ID for a deferred |
798 value indicating an applied/deferred fix (-1, 0, 1), |
615 fix (integer) |
799 a message for the fix (string) and an ID for a deferred |
616 </dd> |
800 fix (integer) |
617 </dl><a NAME="CodeStyleFixer.__fixD242" ID="CodeStyleFixer.__fixD242"></a> |
801 </dd> |
|
802 </dl> |
|
803 <a NAME="CodeStyleFixer.__fixD242" ID="CodeStyleFixer.__fixD242"></a> |
618 <h4>CodeStyleFixer.__fixD242</h4> |
804 <h4>CodeStyleFixer.__fixD242</h4> |
619 <b>__fixD242</b>(<i>code, line, pos, apply=False</i>) |
805 <b>__fixD242</b>(<i>code, line, pos, apply=False</i>) |
|
806 |
620 <p> |
807 <p> |
621 Private method to fix a class or function/method docstring preceded |
808 Private method to fix a class or function/method docstring preceded |
622 by a blank line. |
809 by a blank line. |
623 </p><p> |
810 </p> |
|
811 <p> |
624 Codes: D242, D244 |
812 Codes: D242, D244 |
625 </p><dl> |
813 </p> |
626 <dt><i>code</i></dt> |
814 <dl> |
627 <dd> |
815 |
628 code of the issue (string) |
816 <dt><i>code</i></dt> |
629 </dd><dt><i>line</i></dt> |
817 <dd> |
630 <dd> |
818 code of the issue (string) |
631 line number of the issue (integer) |
819 </dd> |
632 </dd><dt><i>pos</i></dt> |
820 <dt><i>line</i></dt> |
633 <dd> |
821 <dd> |
634 position inside line (integer) |
822 line number of the issue (integer) |
635 </dd><dt><i>apply=</i></dt> |
823 </dd> |
|
824 <dt><i>pos</i></dt> |
|
825 <dd> |
|
826 position inside line (integer) |
|
827 </dd> |
|
828 <dt><i>apply=</i></dt> |
636 <dd> |
829 <dd> |
637 flag indicating, that the fix should be applied |
830 flag indicating, that the fix should be applied |
638 (boolean) |
831 (boolean) |
639 </dd> |
832 </dd> |
640 </dl><dl> |
833 </dl> |
641 <dt>Returns:</dt> |
834 <dl> |
642 <dd> |
835 <dt>Returns:</dt> |
643 value indicating an applied/deferred fix (-1, 0, 1), |
836 <dd> |
644 a message for the fix (string) and an ID for a deferred |
837 value indicating an applied/deferred fix (-1, 0, 1), |
645 fix (integer) |
838 a message for the fix (string) and an ID for a deferred |
646 </dd> |
839 fix (integer) |
647 </dl><a NAME="CodeStyleFixer.__fixD243" ID="CodeStyleFixer.__fixD243"></a> |
840 </dd> |
|
841 </dl> |
|
842 <a NAME="CodeStyleFixer.__fixD243" ID="CodeStyleFixer.__fixD243"></a> |
648 <h4>CodeStyleFixer.__fixD243</h4> |
843 <h4>CodeStyleFixer.__fixD243</h4> |
649 <b>__fixD243</b>(<i>code, line, pos, apply=False</i>) |
844 <b>__fixD243</b>(<i>code, line, pos, apply=False</i>) |
|
845 |
650 <p> |
846 <p> |
651 Private method to fix a class or function/method docstring followed |
847 Private method to fix a class or function/method docstring followed |
652 by a blank line. |
848 by a blank line. |
653 </p><p> |
849 </p> |
|
850 <p> |
654 Codes: D243, D245 |
851 Codes: D243, D245 |
655 </p><dl> |
852 </p> |
656 <dt><i>code</i></dt> |
853 <dl> |
657 <dd> |
854 |
658 code of the issue (string) |
855 <dt><i>code</i></dt> |
659 </dd><dt><i>line</i></dt> |
856 <dd> |
660 <dd> |
857 code of the issue (string) |
661 line number of the issue (integer) |
858 </dd> |
662 </dd><dt><i>pos</i></dt> |
859 <dt><i>line</i></dt> |
663 <dd> |
860 <dd> |
664 position inside line (integer) |
861 line number of the issue (integer) |
665 </dd><dt><i>apply=</i></dt> |
862 </dd> |
|
863 <dt><i>pos</i></dt> |
|
864 <dd> |
|
865 position inside line (integer) |
|
866 </dd> |
|
867 <dt><i>apply=</i></dt> |
666 <dd> |
868 <dd> |
667 flag indicating, that the fix should be applied |
869 flag indicating, that the fix should be applied |
668 (boolean) |
870 (boolean) |
669 </dd> |
871 </dd> |
670 </dl><dl> |
872 </dl> |
671 <dt>Returns:</dt> |
873 <dl> |
672 <dd> |
874 <dt>Returns:</dt> |
673 value indicating an applied/deferred fix (-1, 0, 1), |
875 <dd> |
674 a message for the fix (string) and an ID for a deferred |
876 value indicating an applied/deferred fix (-1, 0, 1), |
675 fix (integer) |
877 a message for the fix (string) and an ID for a deferred |
676 </dd> |
878 fix (integer) |
677 </dl><a NAME="CodeStyleFixer.__fixD247" ID="CodeStyleFixer.__fixD247"></a> |
879 </dd> |
|
880 </dl> |
|
881 <a NAME="CodeStyleFixer.__fixD247" ID="CodeStyleFixer.__fixD247"></a> |
678 <h4>CodeStyleFixer.__fixD247</h4> |
882 <h4>CodeStyleFixer.__fixD247</h4> |
679 <b>__fixD247</b>(<i>code, line, pos, apply=False</i>) |
883 <b>__fixD247</b>(<i>code, line, pos, apply=False</i>) |
|
884 |
680 <p> |
885 <p> |
681 Private method to fix a last paragraph of a docstring followed |
886 Private method to fix a last paragraph of a docstring followed |
682 by a blank line. |
887 by a blank line. |
683 </p><p> |
888 </p> |
|
889 <p> |
684 Codes: D247 |
890 Codes: D247 |
685 </p><dl> |
891 </p> |
686 <dt><i>code</i></dt> |
892 <dl> |
687 <dd> |
893 |
688 code of the issue (string) |
894 <dt><i>code</i></dt> |
689 </dd><dt><i>line</i></dt> |
895 <dd> |
690 <dd> |
896 code of the issue (string) |
691 line number of the issue (integer) |
897 </dd> |
692 </dd><dt><i>pos</i></dt> |
898 <dt><i>line</i></dt> |
693 <dd> |
899 <dd> |
694 position inside line (integer) |
900 line number of the issue (integer) |
695 </dd><dt><i>apply=</i></dt> |
901 </dd> |
|
902 <dt><i>pos</i></dt> |
|
903 <dd> |
|
904 position inside line (integer) |
|
905 </dd> |
|
906 <dt><i>apply=</i></dt> |
696 <dd> |
907 <dd> |
697 flag indicating, that the fix should be applied |
908 flag indicating, that the fix should be applied |
698 (boolean) |
909 (boolean) |
699 </dd> |
910 </dd> |
700 </dl><dl> |
911 </dl> |
701 <dt>Returns:</dt> |
912 <dl> |
702 <dd> |
913 <dt>Returns:</dt> |
703 value indicating an applied/deferred fix (-1, 0, 1), |
914 <dd> |
704 a message for the fix (string) and an ID for a deferred |
915 value indicating an applied/deferred fix (-1, 0, 1), |
705 fix (integer) |
916 a message for the fix (string) and an ID for a deferred |
706 </dd> |
917 fix (integer) |
707 </dl><a NAME="CodeStyleFixer.__fixE101" ID="CodeStyleFixer.__fixE101"></a> |
918 </dd> |
|
919 </dl> |
|
920 <a NAME="CodeStyleFixer.__fixE101" ID="CodeStyleFixer.__fixE101"></a> |
708 <h4>CodeStyleFixer.__fixE101</h4> |
921 <h4>CodeStyleFixer.__fixE101</h4> |
709 <b>__fixE101</b>(<i>code, line, pos</i>) |
922 <b>__fixE101</b>(<i>code, line, pos</i>) |
|
923 |
710 <p> |
924 <p> |
711 Private method to fix obsolete tab usage and indentation errors. |
925 Private method to fix obsolete tab usage and indentation errors. |
712 </p><p> |
926 </p> |
|
927 <p> |
713 Codes: E101, E111, W191 |
928 Codes: E101, E111, W191 |
714 </p><dl> |
929 </p> |
715 <dt><i>code</i></dt> |
930 <dl> |
716 <dd> |
931 |
717 code of the issue (string) |
932 <dt><i>code</i></dt> |
718 </dd><dt><i>line</i></dt> |
933 <dd> |
719 <dd> |
934 code of the issue (string) |
720 line number of the issue (integer) |
935 </dd> |
721 </dd><dt><i>pos</i></dt> |
936 <dt><i>line</i></dt> |
722 <dd> |
937 <dd> |
723 position inside line (integer) |
938 line number of the issue (integer) |
724 </dd> |
939 </dd> |
725 </dl><dl> |
940 <dt><i>pos</i></dt> |
726 <dt>Returns:</dt> |
941 <dd> |
727 <dd> |
942 position inside line (integer) |
728 value indicating an applied/deferred fix (-1, 0, 1), |
943 </dd> |
729 a message for the fix (string) and an ID for a deferred |
944 </dl> |
730 fix (integer) |
945 <dl> |
731 </dd> |
946 <dt>Returns:</dt> |
732 </dl><a NAME="CodeStyleFixer.__fixE121" ID="CodeStyleFixer.__fixE121"></a> |
947 <dd> |
|
948 value indicating an applied/deferred fix (-1, 0, 1), |
|
949 a message for the fix (string) and an ID for a deferred |
|
950 fix (integer) |
|
951 </dd> |
|
952 </dl> |
|
953 <a NAME="CodeStyleFixer.__fixE121" ID="CodeStyleFixer.__fixE121"></a> |
733 <h4>CodeStyleFixer.__fixE121</h4> |
954 <h4>CodeStyleFixer.__fixE121</h4> |
734 <b>__fixE121</b>(<i>code, line, pos, apply=False</i>) |
955 <b>__fixE121</b>(<i>code, line, pos, apply=False</i>) |
|
956 |
735 <p> |
957 <p> |
736 Private method to fix the indentation of continuation lines and |
958 Private method to fix the indentation of continuation lines and |
737 closing brackets. |
959 closing brackets. |
738 </p><p> |
960 </p> |
|
961 <p> |
739 Codes: E121, E124 |
962 Codes: E121, E124 |
740 </p><dl> |
963 </p> |
741 <dt><i>code</i></dt> |
964 <dl> |
742 <dd> |
965 |
743 code of the issue (string) |
966 <dt><i>code</i></dt> |
744 </dd><dt><i>line</i></dt> |
967 <dd> |
745 <dd> |
968 code of the issue (string) |
746 line number of the issue (integer) |
969 </dd> |
747 </dd><dt><i>pos</i></dt> |
970 <dt><i>line</i></dt> |
748 <dd> |
971 <dd> |
749 position inside line (integer) |
972 line number of the issue (integer) |
750 </dd><dt><i>apply=</i></dt> |
973 </dd> |
|
974 <dt><i>pos</i></dt> |
|
975 <dd> |
|
976 position inside line (integer) |
|
977 </dd> |
|
978 <dt><i>apply=</i></dt> |
751 <dd> |
979 <dd> |
752 flag indicating, that the fix should be applied |
980 flag indicating, that the fix should be applied |
753 (boolean) |
981 (boolean) |
754 </dd> |
982 </dd> |
755 </dl><dl> |
983 </dl> |
756 <dt>Returns:</dt> |
984 <dl> |
757 <dd> |
985 <dt>Returns:</dt> |
758 value indicating an applied/deferred fix (-1, 0, 1), |
986 <dd> |
759 a message for the fix (string) and an ID for a deferred |
987 value indicating an applied/deferred fix (-1, 0, 1), |
760 fix (integer) |
988 a message for the fix (string) and an ID for a deferred |
761 </dd> |
989 fix (integer) |
762 </dl><a NAME="CodeStyleFixer.__fixE122" ID="CodeStyleFixer.__fixE122"></a> |
990 </dd> |
|
991 </dl> |
|
992 <a NAME="CodeStyleFixer.__fixE122" ID="CodeStyleFixer.__fixE122"></a> |
763 <h4>CodeStyleFixer.__fixE122</h4> |
993 <h4>CodeStyleFixer.__fixE122</h4> |
764 <b>__fixE122</b>(<i>code, line, pos, apply=False</i>) |
994 <b>__fixE122</b>(<i>code, line, pos, apply=False</i>) |
|
995 |
765 <p> |
996 <p> |
766 Private method to fix a missing indentation of continuation lines. |
997 Private method to fix a missing indentation of continuation lines. |
767 </p><p> |
998 </p> |
|
999 <p> |
768 Codes: E122 |
1000 Codes: E122 |
769 </p><dl> |
1001 </p> |
770 <dt><i>code</i></dt> |
1002 <dl> |
771 <dd> |
1003 |
772 code of the issue (string) |
1004 <dt><i>code</i></dt> |
773 </dd><dt><i>line</i></dt> |
1005 <dd> |
774 <dd> |
1006 code of the issue (string) |
775 line number of the issue (integer) |
1007 </dd> |
776 </dd><dt><i>pos</i></dt> |
1008 <dt><i>line</i></dt> |
777 <dd> |
1009 <dd> |
778 position inside line (integer) |
1010 line number of the issue (integer) |
779 </dd><dt><i>apply=</i></dt> |
1011 </dd> |
|
1012 <dt><i>pos</i></dt> |
|
1013 <dd> |
|
1014 position inside line (integer) |
|
1015 </dd> |
|
1016 <dt><i>apply=</i></dt> |
780 <dd> |
1017 <dd> |
781 flag indicating, that the fix should be applied |
1018 flag indicating, that the fix should be applied |
782 (boolean) |
1019 (boolean) |
783 </dd> |
1020 </dd> |
784 </dl><dl> |
1021 </dl> |
785 <dt>Returns:</dt> |
1022 <dl> |
786 <dd> |
1023 <dt>Returns:</dt> |
787 value indicating an applied/deferred fix (-1, 0, 1), |
1024 <dd> |
788 a message for the fix (string) and an ID for a deferred |
1025 value indicating an applied/deferred fix (-1, 0, 1), |
789 fix (integer) |
1026 a message for the fix (string) and an ID for a deferred |
790 </dd> |
1027 fix (integer) |
791 </dl><a NAME="CodeStyleFixer.__fixE123" ID="CodeStyleFixer.__fixE123"></a> |
1028 </dd> |
|
1029 </dl> |
|
1030 <a NAME="CodeStyleFixer.__fixE123" ID="CodeStyleFixer.__fixE123"></a> |
792 <h4>CodeStyleFixer.__fixE123</h4> |
1031 <h4>CodeStyleFixer.__fixE123</h4> |
793 <b>__fixE123</b>(<i>code, line, pos, apply=False</i>) |
1032 <b>__fixE123</b>(<i>code, line, pos, apply=False</i>) |
|
1033 |
794 <p> |
1034 <p> |
795 Private method to fix the indentation of a closing bracket lines. |
1035 Private method to fix the indentation of a closing bracket lines. |
796 </p><p> |
1036 </p> |
|
1037 <p> |
797 Codes: E123 |
1038 Codes: E123 |
798 </p><dl> |
1039 </p> |
799 <dt><i>code</i></dt> |
1040 <dl> |
800 <dd> |
1041 |
801 code of the issue (string) |
1042 <dt><i>code</i></dt> |
802 </dd><dt><i>line</i></dt> |
1043 <dd> |
803 <dd> |
1044 code of the issue (string) |
804 line number of the issue (integer) |
1045 </dd> |
805 </dd><dt><i>pos</i></dt> |
1046 <dt><i>line</i></dt> |
806 <dd> |
1047 <dd> |
807 position inside line (integer) |
1048 line number of the issue (integer) |
808 </dd><dt><i>apply=</i></dt> |
1049 </dd> |
|
1050 <dt><i>pos</i></dt> |
|
1051 <dd> |
|
1052 position inside line (integer) |
|
1053 </dd> |
|
1054 <dt><i>apply=</i></dt> |
809 <dd> |
1055 <dd> |
810 flag indicating, that the fix should be applied |
1056 flag indicating, that the fix should be applied |
811 (boolean) |
1057 (boolean) |
812 </dd> |
1058 </dd> |
813 </dl><dl> |
1059 </dl> |
814 <dt>Returns:</dt> |
1060 <dl> |
815 <dd> |
1061 <dt>Returns:</dt> |
816 value indicating an applied/deferred fix (-1, 0, 1), |
1062 <dd> |
817 a message for the fix (string) and an ID for a deferred |
1063 value indicating an applied/deferred fix (-1, 0, 1), |
818 fix (integer) |
1064 a message for the fix (string) and an ID for a deferred |
819 </dd> |
1065 fix (integer) |
820 </dl><a NAME="CodeStyleFixer.__fixE125" ID="CodeStyleFixer.__fixE125"></a> |
1066 </dd> |
|
1067 </dl> |
|
1068 <a NAME="CodeStyleFixer.__fixE125" ID="CodeStyleFixer.__fixE125"></a> |
821 <h4>CodeStyleFixer.__fixE125</h4> |
1069 <h4>CodeStyleFixer.__fixE125</h4> |
822 <b>__fixE125</b>(<i>code, line, pos, apply=False</i>) |
1070 <b>__fixE125</b>(<i>code, line, pos, apply=False</i>) |
|
1071 |
823 <p> |
1072 <p> |
824 Private method to fix the indentation of continuation lines not |
1073 Private method to fix the indentation of continuation lines not |
825 distinguishable from next logical line. |
1074 distinguishable from next logical line. |
826 </p><p> |
1075 </p> |
|
1076 <p> |
827 Codes: E125 |
1077 Codes: E125 |
828 </p><dl> |
1078 </p> |
829 <dt><i>code</i></dt> |
1079 <dl> |
830 <dd> |
1080 |
831 code of the issue (string) |
1081 <dt><i>code</i></dt> |
832 </dd><dt><i>line</i></dt> |
1082 <dd> |
833 <dd> |
1083 code of the issue (string) |
834 line number of the issue (integer) |
1084 </dd> |
835 </dd><dt><i>pos</i></dt> |
1085 <dt><i>line</i></dt> |
836 <dd> |
1086 <dd> |
837 position inside line (integer) |
1087 line number of the issue (integer) |
838 </dd><dt><i>apply=</i></dt> |
1088 </dd> |
|
1089 <dt><i>pos</i></dt> |
|
1090 <dd> |
|
1091 position inside line (integer) |
|
1092 </dd> |
|
1093 <dt><i>apply=</i></dt> |
839 <dd> |
1094 <dd> |
840 flag indicating, that the fix should be applied |
1095 flag indicating, that the fix should be applied |
841 (boolean) |
1096 (boolean) |
842 </dd> |
1097 </dd> |
843 </dl><dl> |
1098 </dl> |
844 <dt>Returns:</dt> |
1099 <dl> |
845 <dd> |
1100 <dt>Returns:</dt> |
846 value indicating an applied/deferred fix (-1, 0, 1), |
1101 <dd> |
847 a message for the fix (string) and an ID for a deferred |
1102 value indicating an applied/deferred fix (-1, 0, 1), |
848 fix (integer) |
1103 a message for the fix (string) and an ID for a deferred |
849 </dd> |
1104 fix (integer) |
850 </dl><a NAME="CodeStyleFixer.__fixE126" ID="CodeStyleFixer.__fixE126"></a> |
1105 </dd> |
|
1106 </dl> |
|
1107 <a NAME="CodeStyleFixer.__fixE126" ID="CodeStyleFixer.__fixE126"></a> |
851 <h4>CodeStyleFixer.__fixE126</h4> |
1108 <h4>CodeStyleFixer.__fixE126</h4> |
852 <b>__fixE126</b>(<i>code, line, pos, apply=False</i>) |
1109 <b>__fixE126</b>(<i>code, line, pos, apply=False</i>) |
|
1110 |
853 <p> |
1111 <p> |
854 Private method to fix over-indented/under-indented hanging |
1112 Private method to fix over-indented/under-indented hanging |
855 indentation. |
1113 indentation. |
856 </p><p> |
1114 </p> |
|
1115 <p> |
857 Codes: E126, E133 |
1116 Codes: E126, E133 |
858 </p><dl> |
1117 </p> |
859 <dt><i>code</i></dt> |
1118 <dl> |
860 <dd> |
1119 |
861 code of the issue (string) |
1120 <dt><i>code</i></dt> |
862 </dd><dt><i>line</i></dt> |
1121 <dd> |
863 <dd> |
1122 code of the issue (string) |
864 line number of the issue (integer) |
1123 </dd> |
865 </dd><dt><i>pos</i></dt> |
1124 <dt><i>line</i></dt> |
866 <dd> |
1125 <dd> |
867 position inside line (integer) |
1126 line number of the issue (integer) |
868 </dd><dt><i>apply=</i></dt> |
1127 </dd> |
|
1128 <dt><i>pos</i></dt> |
|
1129 <dd> |
|
1130 position inside line (integer) |
|
1131 </dd> |
|
1132 <dt><i>apply=</i></dt> |
869 <dd> |
1133 <dd> |
870 flag indicating, that the fix should be applied |
1134 flag indicating, that the fix should be applied |
871 (boolean) |
1135 (boolean) |
872 </dd> |
1136 </dd> |
873 </dl><dl> |
1137 </dl> |
874 <dt>Returns:</dt> |
1138 <dl> |
875 <dd> |
1139 <dt>Returns:</dt> |
876 value indicating an applied/deferred fix (-1, 0, 1), |
1140 <dd> |
877 a message for the fix (string) and an ID for a deferred |
1141 value indicating an applied/deferred fix (-1, 0, 1), |
878 fix (integer) |
1142 a message for the fix (string) and an ID for a deferred |
879 </dd> |
1143 fix (integer) |
880 </dl><a NAME="CodeStyleFixer.__fixE127" ID="CodeStyleFixer.__fixE127"></a> |
1144 </dd> |
|
1145 </dl> |
|
1146 <a NAME="CodeStyleFixer.__fixE127" ID="CodeStyleFixer.__fixE127"></a> |
881 <h4>CodeStyleFixer.__fixE127</h4> |
1147 <h4>CodeStyleFixer.__fixE127</h4> |
882 <b>__fixE127</b>(<i>code, line, pos, apply=False</i>) |
1148 <b>__fixE127</b>(<i>code, line, pos, apply=False</i>) |
|
1149 |
883 <p> |
1150 <p> |
884 Private method to fix over/under indented lines. |
1151 Private method to fix over/under indented lines. |
885 </p><p> |
1152 </p> |
|
1153 <p> |
886 Codes: E127, E128 |
1154 Codes: E127, E128 |
887 </p><dl> |
1155 </p> |
888 <dt><i>code</i></dt> |
1156 <dl> |
889 <dd> |
1157 |
890 code of the issue (string) |
1158 <dt><i>code</i></dt> |
891 </dd><dt><i>line</i></dt> |
1159 <dd> |
892 <dd> |
1160 code of the issue (string) |
893 line number of the issue (integer) |
1161 </dd> |
894 </dd><dt><i>pos</i></dt> |
1162 <dt><i>line</i></dt> |
895 <dd> |
1163 <dd> |
896 position inside line (integer) |
1164 line number of the issue (integer) |
897 </dd><dt><i>apply=</i></dt> |
1165 </dd> |
|
1166 <dt><i>pos</i></dt> |
|
1167 <dd> |
|
1168 position inside line (integer) |
|
1169 </dd> |
|
1170 <dt><i>apply=</i></dt> |
898 <dd> |
1171 <dd> |
899 flag indicating, that the fix should be applied |
1172 flag indicating, that the fix should be applied |
900 (boolean) |
1173 (boolean) |
901 </dd> |
1174 </dd> |
902 </dl><dl> |
1175 </dl> |
903 <dt>Returns:</dt> |
1176 <dl> |
904 <dd> |
1177 <dt>Returns:</dt> |
905 value indicating an applied/deferred fix (-1, 0, 1), |
1178 <dd> |
906 a message for the fix (string) and an ID for a deferred |
1179 value indicating an applied/deferred fix (-1, 0, 1), |
907 fix (integer) |
1180 a message for the fix (string) and an ID for a deferred |
908 </dd> |
1181 fix (integer) |
909 </dl><a NAME="CodeStyleFixer.__fixE201" ID="CodeStyleFixer.__fixE201"></a> |
1182 </dd> |
|
1183 </dl> |
|
1184 <a NAME="CodeStyleFixer.__fixE201" ID="CodeStyleFixer.__fixE201"></a> |
910 <h4>CodeStyleFixer.__fixE201</h4> |
1185 <h4>CodeStyleFixer.__fixE201</h4> |
911 <b>__fixE201</b>(<i>code, line, pos</i>) |
1186 <b>__fixE201</b>(<i>code, line, pos</i>) |
|
1187 |
912 <p> |
1188 <p> |
913 Private method to fix extraneous whitespace. |
1189 Private method to fix extraneous whitespace. |
914 </p><p> |
1190 </p> |
|
1191 <p> |
915 Codes: E201, E202, E203, E211 |
1192 Codes: E201, E202, E203, E211 |
916 </p><dl> |
1193 </p> |
917 <dt><i>code</i></dt> |
1194 <dl> |
918 <dd> |
1195 |
919 code of the issue (string) |
1196 <dt><i>code</i></dt> |
920 </dd><dt><i>line</i></dt> |
1197 <dd> |
921 <dd> |
1198 code of the issue (string) |
922 line number of the issue (integer) |
1199 </dd> |
923 </dd><dt><i>pos</i></dt> |
1200 <dt><i>line</i></dt> |
924 <dd> |
1201 <dd> |
925 position inside line (integer) |
1202 line number of the issue (integer) |
926 </dd> |
1203 </dd> |
927 </dl><dl> |
1204 <dt><i>pos</i></dt> |
928 <dt>Returns:</dt> |
1205 <dd> |
929 <dd> |
1206 position inside line (integer) |
930 value indicating an applied/deferred fix (-1, 0, 1), |
1207 </dd> |
931 a message for the fix (string) and an ID for a deferred |
1208 </dl> |
932 fix (integer) |
1209 <dl> |
933 </dd> |
1210 <dt>Returns:</dt> |
934 </dl><a NAME="CodeStyleFixer.__fixE221" ID="CodeStyleFixer.__fixE221"></a> |
1211 <dd> |
|
1212 value indicating an applied/deferred fix (-1, 0, 1), |
|
1213 a message for the fix (string) and an ID for a deferred |
|
1214 fix (integer) |
|
1215 </dd> |
|
1216 </dl> |
|
1217 <a NAME="CodeStyleFixer.__fixE221" ID="CodeStyleFixer.__fixE221"></a> |
935 <h4>CodeStyleFixer.__fixE221</h4> |
1218 <h4>CodeStyleFixer.__fixE221</h4> |
936 <b>__fixE221</b>(<i>code, line, pos</i>) |
1219 <b>__fixE221</b>(<i>code, line, pos</i>) |
|
1220 |
937 <p> |
1221 <p> |
938 Private method to fix extraneous whitespace around operator or |
1222 Private method to fix extraneous whitespace around operator or |
939 keyword. |
1223 keyword. |
940 </p><p> |
1224 </p> |
|
1225 <p> |
941 Codes: E221, E222, E223, E224, E241, E242, E271, E272, E273, E274 |
1226 Codes: E221, E222, E223, E224, E241, E242, E271, E272, E273, E274 |
942 </p><dl> |
1227 </p> |
943 <dt><i>code</i></dt> |
1228 <dl> |
944 <dd> |
1229 |
945 code of the issue (string) |
1230 <dt><i>code</i></dt> |
946 </dd><dt><i>line</i></dt> |
1231 <dd> |
947 <dd> |
1232 code of the issue (string) |
948 line number of the issue (integer) |
1233 </dd> |
949 </dd><dt><i>pos</i></dt> |
1234 <dt><i>line</i></dt> |
950 <dd> |
1235 <dd> |
951 position inside line (integer) |
1236 line number of the issue (integer) |
952 </dd> |
1237 </dd> |
953 </dl><dl> |
1238 <dt><i>pos</i></dt> |
954 <dt>Returns:</dt> |
1239 <dd> |
955 <dd> |
1240 position inside line (integer) |
956 value indicating an applied/deferred fix (-1, 0, 1), |
1241 </dd> |
957 a message for the fix (string) and an ID for a deferred |
1242 </dl> |
958 fix (integer) |
1243 <dl> |
959 </dd> |
1244 <dt>Returns:</dt> |
960 </dl><a NAME="CodeStyleFixer.__fixE225" ID="CodeStyleFixer.__fixE225"></a> |
1245 <dd> |
|
1246 value indicating an applied/deferred fix (-1, 0, 1), |
|
1247 a message for the fix (string) and an ID for a deferred |
|
1248 fix (integer) |
|
1249 </dd> |
|
1250 </dl> |
|
1251 <a NAME="CodeStyleFixer.__fixE225" ID="CodeStyleFixer.__fixE225"></a> |
961 <h4>CodeStyleFixer.__fixE225</h4> |
1252 <h4>CodeStyleFixer.__fixE225</h4> |
962 <b>__fixE225</b>(<i>code, line, pos</i>) |
1253 <b>__fixE225</b>(<i>code, line, pos</i>) |
|
1254 |
963 <p> |
1255 <p> |
964 Private method to fix extraneous whitespaces around operator. |
1256 Private method to fix extraneous whitespaces around operator. |
965 </p><p> |
1257 </p> |
|
1258 <p> |
966 Codes: E225, E226, E227, E228 |
1259 Codes: E225, E226, E227, E228 |
967 </p><dl> |
1260 </p> |
968 <dt><i>code</i></dt> |
1261 <dl> |
969 <dd> |
1262 |
970 code of the issue (string) |
1263 <dt><i>code</i></dt> |
971 </dd><dt><i>line</i></dt> |
1264 <dd> |
972 <dd> |
1265 code of the issue (string) |
973 line number of the issue (integer) |
1266 </dd> |
974 </dd><dt><i>pos</i></dt> |
1267 <dt><i>line</i></dt> |
975 <dd> |
1268 <dd> |
976 position inside line (integer) |
1269 line number of the issue (integer) |
977 </dd> |
1270 </dd> |
978 </dl><dl> |
1271 <dt><i>pos</i></dt> |
979 <dt>Returns:</dt> |
1272 <dd> |
980 <dd> |
1273 position inside line (integer) |
981 value indicating an applied/deferred fix (-1, 0, 1), |
1274 </dd> |
982 a message for the fix (string) and an ID for a deferred |
1275 </dl> |
983 fix (integer) |
1276 <dl> |
984 </dd> |
1277 <dt>Returns:</dt> |
985 </dl><a NAME="CodeStyleFixer.__fixE231" ID="CodeStyleFixer.__fixE231"></a> |
1278 <dd> |
|
1279 value indicating an applied/deferred fix (-1, 0, 1), |
|
1280 a message for the fix (string) and an ID for a deferred |
|
1281 fix (integer) |
|
1282 </dd> |
|
1283 </dl> |
|
1284 <a NAME="CodeStyleFixer.__fixE231" ID="CodeStyleFixer.__fixE231"></a> |
986 <h4>CodeStyleFixer.__fixE231</h4> |
1285 <h4>CodeStyleFixer.__fixE231</h4> |
987 <b>__fixE231</b>(<i>code, line, pos</i>) |
1286 <b>__fixE231</b>(<i>code, line, pos</i>) |
|
1287 |
988 <p> |
1288 <p> |
989 Private method to fix missing whitespace after ',;:'. |
1289 Private method to fix missing whitespace after ',;:'. |
990 </p><p> |
1290 </p> |
|
1291 <p> |
991 Codes: E231 |
1292 Codes: E231 |
992 </p><dl> |
1293 </p> |
993 <dt><i>code</i></dt> |
1294 <dl> |
994 <dd> |
1295 |
995 code of the issue (string) |
1296 <dt><i>code</i></dt> |
996 </dd><dt><i>line</i></dt> |
1297 <dd> |
997 <dd> |
1298 code of the issue (string) |
998 line number of the issue (integer) |
1299 </dd> |
999 </dd><dt><i>pos</i></dt> |
1300 <dt><i>line</i></dt> |
1000 <dd> |
1301 <dd> |
1001 position inside line (integer) |
1302 line number of the issue (integer) |
1002 </dd> |
1303 </dd> |
1003 </dl><dl> |
1304 <dt><i>pos</i></dt> |
1004 <dt>Returns:</dt> |
1305 <dd> |
1005 <dd> |
1306 position inside line (integer) |
1006 value indicating an applied/deferred fix (-1, 0, 1), |
1307 </dd> |
1007 a message for the fix (string) and an ID for a deferred |
1308 </dl> |
1008 fix (integer) |
1309 <dl> |
1009 </dd> |
1310 <dt>Returns:</dt> |
1010 </dl><a NAME="CodeStyleFixer.__fixE251" ID="CodeStyleFixer.__fixE251"></a> |
1311 <dd> |
|
1312 value indicating an applied/deferred fix (-1, 0, 1), |
|
1313 a message for the fix (string) and an ID for a deferred |
|
1314 fix (integer) |
|
1315 </dd> |
|
1316 </dl> |
|
1317 <a NAME="CodeStyleFixer.__fixE251" ID="CodeStyleFixer.__fixE251"></a> |
1011 <h4>CodeStyleFixer.__fixE251</h4> |
1318 <h4>CodeStyleFixer.__fixE251</h4> |
1012 <b>__fixE251</b>(<i>code, line, pos</i>) |
1319 <b>__fixE251</b>(<i>code, line, pos</i>) |
|
1320 |
1013 <p> |
1321 <p> |
1014 Private method to fix extraneous whitespace around keyword and |
1322 Private method to fix extraneous whitespace around keyword and |
1015 default parameter equals. |
1323 default parameter equals. |
1016 </p><p> |
1324 </p> |
|
1325 <p> |
1017 Codes: E251 |
1326 Codes: E251 |
1018 </p><dl> |
1327 </p> |
1019 <dt><i>code</i></dt> |
1328 <dl> |
1020 <dd> |
1329 |
1021 code of the issue (string) |
1330 <dt><i>code</i></dt> |
1022 </dd><dt><i>line</i></dt> |
1331 <dd> |
1023 <dd> |
1332 code of the issue (string) |
1024 line number of the issue (integer) |
1333 </dd> |
1025 </dd><dt><i>pos</i></dt> |
1334 <dt><i>line</i></dt> |
1026 <dd> |
1335 <dd> |
1027 position inside line (integer) |
1336 line number of the issue (integer) |
1028 </dd> |
1337 </dd> |
1029 </dl><dl> |
1338 <dt><i>pos</i></dt> |
1030 <dt>Returns:</dt> |
1339 <dd> |
1031 <dd> |
1340 position inside line (integer) |
1032 value indicating an applied/deferred fix (-1, 0, 1), |
1341 </dd> |
1033 a message for the fix (string) and an ID for a deferred |
1342 </dl> |
1034 fix (integer) |
1343 <dl> |
1035 </dd> |
1344 <dt>Returns:</dt> |
1036 </dl><a NAME="CodeStyleFixer.__fixE261" ID="CodeStyleFixer.__fixE261"></a> |
1345 <dd> |
|
1346 value indicating an applied/deferred fix (-1, 0, 1), |
|
1347 a message for the fix (string) and an ID for a deferred |
|
1348 fix (integer) |
|
1349 </dd> |
|
1350 </dl> |
|
1351 <a NAME="CodeStyleFixer.__fixE261" ID="CodeStyleFixer.__fixE261"></a> |
1037 <h4>CodeStyleFixer.__fixE261</h4> |
1352 <h4>CodeStyleFixer.__fixE261</h4> |
1038 <b>__fixE261</b>(<i>code, line, pos</i>) |
1353 <b>__fixE261</b>(<i>code, line, pos</i>) |
|
1354 |
1039 <p> |
1355 <p> |
1040 Private method to fix whitespace before or after inline comment. |
1356 Private method to fix whitespace before or after inline comment. |
1041 </p><p> |
1357 </p> |
|
1358 <p> |
1042 Codes: E261, E262 |
1359 Codes: E261, E262 |
1043 </p><dl> |
1360 </p> |
1044 <dt><i>code</i></dt> |
1361 <dl> |
1045 <dd> |
1362 |
1046 code of the issue (string) |
1363 <dt><i>code</i></dt> |
1047 </dd><dt><i>line</i></dt> |
1364 <dd> |
1048 <dd> |
1365 code of the issue (string) |
1049 line number of the issue (integer) |
1366 </dd> |
1050 </dd><dt><i>pos</i></dt> |
1367 <dt><i>line</i></dt> |
1051 <dd> |
1368 <dd> |
1052 position inside line (integer) |
1369 line number of the issue (integer) |
1053 </dd> |
1370 </dd> |
1054 </dl><dl> |
1371 <dt><i>pos</i></dt> |
1055 <dt>Returns:</dt> |
1372 <dd> |
1056 <dd> |
1373 position inside line (integer) |
1057 value indicating an applied/deferred fix (-1, 0, 1), |
1374 </dd> |
1058 a message for the fix (string) and an ID for a deferred |
1375 </dl> |
1059 fix (integer) |
1376 <dl> |
1060 </dd> |
1377 <dt>Returns:</dt> |
1061 </dl><a NAME="CodeStyleFixer.__fixE304" ID="CodeStyleFixer.__fixE304"></a> |
1378 <dd> |
|
1379 value indicating an applied/deferred fix (-1, 0, 1), |
|
1380 a message for the fix (string) and an ID for a deferred |
|
1381 fix (integer) |
|
1382 </dd> |
|
1383 </dl> |
|
1384 <a NAME="CodeStyleFixer.__fixE304" ID="CodeStyleFixer.__fixE304"></a> |
1062 <h4>CodeStyleFixer.__fixE304</h4> |
1385 <h4>CodeStyleFixer.__fixE304</h4> |
1063 <b>__fixE304</b>(<i>code, line, pos, apply=False</i>) |
1386 <b>__fixE304</b>(<i>code, line, pos, apply=False</i>) |
|
1387 |
1064 <p> |
1388 <p> |
1065 Private method to fix superfluous blank lines after a function |
1389 Private method to fix superfluous blank lines after a function |
1066 decorator. |
1390 decorator. |
1067 </p><p> |
1391 </p> |
|
1392 <p> |
1068 Codes: E304 |
1393 Codes: E304 |
1069 </p><dl> |
1394 </p> |
1070 <dt><i>code</i></dt> |
1395 <dl> |
1071 <dd> |
1396 |
1072 code of the issue (string) |
1397 <dt><i>code</i></dt> |
1073 </dd><dt><i>line</i></dt> |
1398 <dd> |
1074 <dd> |
1399 code of the issue (string) |
1075 line number of the issue (integer) |
1400 </dd> |
1076 </dd><dt><i>pos</i></dt> |
1401 <dt><i>line</i></dt> |
1077 <dd> |
1402 <dd> |
1078 position inside line (integer) |
1403 line number of the issue (integer) |
1079 </dd><dt><i>apply=</i></dt> |
1404 </dd> |
|
1405 <dt><i>pos</i></dt> |
|
1406 <dd> |
|
1407 position inside line (integer) |
|
1408 </dd> |
|
1409 <dt><i>apply=</i></dt> |
1080 <dd> |
1410 <dd> |
1081 flag indicating, that the fix should be applied |
1411 flag indicating, that the fix should be applied |
1082 (boolean) |
1412 (boolean) |
1083 </dd> |
1413 </dd> |
1084 </dl><dl> |
1414 </dl> |
1085 <dt>Returns:</dt> |
1415 <dl> |
1086 <dd> |
1416 <dt>Returns:</dt> |
1087 value indicating an applied/deferred fix (-1, 0, 1), |
1417 <dd> |
1088 a message for the fix (string) and an ID for a deferred |
1418 value indicating an applied/deferred fix (-1, 0, 1), |
1089 fix (integer) |
1419 a message for the fix (string) and an ID for a deferred |
1090 </dd> |
1420 fix (integer) |
1091 </dl><a NAME="CodeStyleFixer.__fixE401" ID="CodeStyleFixer.__fixE401"></a> |
1421 </dd> |
|
1422 </dl> |
|
1423 <a NAME="CodeStyleFixer.__fixE401" ID="CodeStyleFixer.__fixE401"></a> |
1092 <h4>CodeStyleFixer.__fixE401</h4> |
1424 <h4>CodeStyleFixer.__fixE401</h4> |
1093 <b>__fixE401</b>(<i>code, line, pos, apply=False</i>) |
1425 <b>__fixE401</b>(<i>code, line, pos, apply=False</i>) |
|
1426 |
1094 <p> |
1427 <p> |
1095 Private method to fix multiple imports on one line. |
1428 Private method to fix multiple imports on one line. |
1096 </p><p> |
1429 </p> |
|
1430 <p> |
1097 Codes: E401 |
1431 Codes: E401 |
1098 </p><dl> |
1432 </p> |
1099 <dt><i>code</i></dt> |
1433 <dl> |
1100 <dd> |
1434 |
1101 code of the issue (string) |
1435 <dt><i>code</i></dt> |
1102 </dd><dt><i>line</i></dt> |
1436 <dd> |
1103 <dd> |
1437 code of the issue (string) |
1104 line number of the issue (integer) |
1438 </dd> |
1105 </dd><dt><i>pos</i></dt> |
1439 <dt><i>line</i></dt> |
1106 <dd> |
1440 <dd> |
1107 position inside line (integer) |
1441 line number of the issue (integer) |
1108 </dd><dt><i>apply=</i></dt> |
1442 </dd> |
|
1443 <dt><i>pos</i></dt> |
|
1444 <dd> |
|
1445 position inside line (integer) |
|
1446 </dd> |
|
1447 <dt><i>apply=</i></dt> |
1109 <dd> |
1448 <dd> |
1110 flag indicating, that the fix should be applied |
1449 flag indicating, that the fix should be applied |
1111 (boolean) |
1450 (boolean) |
1112 </dd> |
1451 </dd> |
1113 </dl><dl> |
1452 </dl> |
1114 <dt>Returns:</dt> |
1453 <dl> |
1115 <dd> |
1454 <dt>Returns:</dt> |
1116 value indicating an applied/deferred fix (-1, 0, 1), |
1455 <dd> |
1117 a message for the fix (string) and an ID for a deferred |
1456 value indicating an applied/deferred fix (-1, 0, 1), |
1118 fix (integer) |
1457 a message for the fix (string) and an ID for a deferred |
1119 </dd> |
1458 fix (integer) |
1120 </dl><a NAME="CodeStyleFixer.__fixE501" ID="CodeStyleFixer.__fixE501"></a> |
1459 </dd> |
|
1460 </dl> |
|
1461 <a NAME="CodeStyleFixer.__fixE501" ID="CodeStyleFixer.__fixE501"></a> |
1121 <h4>CodeStyleFixer.__fixE501</h4> |
1462 <h4>CodeStyleFixer.__fixE501</h4> |
1122 <b>__fixE501</b>(<i>code, line, pos, apply=False</i>) |
1463 <b>__fixE501</b>(<i>code, line, pos, apply=False</i>) |
|
1464 |
1123 <p> |
1465 <p> |
1124 Private method to fix the long lines by breaking them. |
1466 Private method to fix the long lines by breaking them. |
1125 </p><p> |
1467 </p> |
|
1468 <p> |
1126 Codes: E501 |
1469 Codes: E501 |
1127 </p><dl> |
1470 </p> |
1128 <dt><i>code</i></dt> |
1471 <dl> |
1129 <dd> |
1472 |
1130 code of the issue (string) |
1473 <dt><i>code</i></dt> |
1131 </dd><dt><i>line</i></dt> |
1474 <dd> |
1132 <dd> |
1475 code of the issue (string) |
1133 line number of the issue (integer) |
1476 </dd> |
1134 </dd><dt><i>pos</i></dt> |
1477 <dt><i>line</i></dt> |
1135 <dd> |
1478 <dd> |
1136 position inside line (integer) |
1479 line number of the issue (integer) |
1137 </dd><dt><i>apply=</i></dt> |
1480 </dd> |
|
1481 <dt><i>pos</i></dt> |
|
1482 <dd> |
|
1483 position inside line (integer) |
|
1484 </dd> |
|
1485 <dt><i>apply=</i></dt> |
1138 <dd> |
1486 <dd> |
1139 flag indicating, that the fix should be applied |
1487 flag indicating, that the fix should be applied |
1140 (boolean) |
1488 (boolean) |
1141 </dd> |
1489 </dd> |
1142 </dl><dl> |
1490 </dl> |
1143 <dt>Returns:</dt> |
1491 <dl> |
1144 <dd> |
1492 <dt>Returns:</dt> |
1145 value indicating an applied/deferred fix (-1, 0, 1), |
1493 <dd> |
1146 a message for the fix (string) and an ID for a deferred |
1494 value indicating an applied/deferred fix (-1, 0, 1), |
1147 fix (integer) |
1495 a message for the fix (string) and an ID for a deferred |
1148 </dd> |
1496 fix (integer) |
1149 </dl><a NAME="CodeStyleFixer.__fixE502" ID="CodeStyleFixer.__fixE502"></a> |
1497 </dd> |
|
1498 </dl> |
|
1499 <a NAME="CodeStyleFixer.__fixE502" ID="CodeStyleFixer.__fixE502"></a> |
1150 <h4>CodeStyleFixer.__fixE502</h4> |
1500 <h4>CodeStyleFixer.__fixE502</h4> |
1151 <b>__fixE502</b>(<i>code, line, pos</i>) |
1501 <b>__fixE502</b>(<i>code, line, pos</i>) |
|
1502 |
1152 <p> |
1503 <p> |
1153 Private method to fix redundant backslash within brackets. |
1504 Private method to fix redundant backslash within brackets. |
1154 </p><p> |
1505 </p> |
|
1506 <p> |
1155 Codes: E502 |
1507 Codes: E502 |
1156 </p><dl> |
1508 </p> |
1157 <dt><i>code</i></dt> |
1509 <dl> |
1158 <dd> |
1510 |
1159 code of the issue (string) |
1511 <dt><i>code</i></dt> |
1160 </dd><dt><i>line</i></dt> |
1512 <dd> |
1161 <dd> |
1513 code of the issue (string) |
1162 line number of the issue (integer) |
1514 </dd> |
1163 </dd><dt><i>pos</i></dt> |
1515 <dt><i>line</i></dt> |
1164 <dd> |
1516 <dd> |
1165 position inside line (integer) |
1517 line number of the issue (integer) |
1166 </dd> |
1518 </dd> |
1167 </dl><dl> |
1519 <dt><i>pos</i></dt> |
1168 <dt>Returns:</dt> |
1520 <dd> |
1169 <dd> |
1521 position inside line (integer) |
1170 value indicating an applied/deferred fix (-1, 0, 1), |
1522 </dd> |
1171 a message for the fix (string) and an ID for a deferred |
1523 </dl> |
1172 fix (integer) |
1524 <dl> |
1173 </dd> |
1525 <dt>Returns:</dt> |
1174 </dl><a NAME="CodeStyleFixer.__fixE701" ID="CodeStyleFixer.__fixE701"></a> |
1526 <dd> |
|
1527 value indicating an applied/deferred fix (-1, 0, 1), |
|
1528 a message for the fix (string) and an ID for a deferred |
|
1529 fix (integer) |
|
1530 </dd> |
|
1531 </dl> |
|
1532 <a NAME="CodeStyleFixer.__fixE701" ID="CodeStyleFixer.__fixE701"></a> |
1175 <h4>CodeStyleFixer.__fixE701</h4> |
1533 <h4>CodeStyleFixer.__fixE701</h4> |
1176 <b>__fixE701</b>(<i>code, line, pos, apply=False</i>) |
1534 <b>__fixE701</b>(<i>code, line, pos, apply=False</i>) |
|
1535 |
1177 <p> |
1536 <p> |
1178 Private method to fix colon-separated compound statements. |
1537 Private method to fix colon-separated compound statements. |
1179 </p><p> |
1538 </p> |
|
1539 <p> |
1180 Codes: E701 |
1540 Codes: E701 |
1181 </p><dl> |
1541 </p> |
1182 <dt><i>code</i></dt> |
1542 <dl> |
1183 <dd> |
1543 |
1184 code of the issue (string) |
1544 <dt><i>code</i></dt> |
1185 </dd><dt><i>line</i></dt> |
1545 <dd> |
1186 <dd> |
1546 code of the issue (string) |
1187 line number of the issue (integer) |
1547 </dd> |
1188 </dd><dt><i>pos</i></dt> |
1548 <dt><i>line</i></dt> |
1189 <dd> |
1549 <dd> |
1190 position inside line (integer) |
1550 line number of the issue (integer) |
1191 </dd><dt><i>apply=</i></dt> |
1551 </dd> |
|
1552 <dt><i>pos</i></dt> |
|
1553 <dd> |
|
1554 position inside line (integer) |
|
1555 </dd> |
|
1556 <dt><i>apply=</i></dt> |
1192 <dd> |
1557 <dd> |
1193 flag indicating, that the fix should be applied |
1558 flag indicating, that the fix should be applied |
1194 (boolean) |
1559 (boolean) |
1195 </dd> |
1560 </dd> |
1196 </dl><dl> |
1561 </dl> |
1197 <dt>Returns:</dt> |
1562 <dl> |
1198 <dd> |
1563 <dt>Returns:</dt> |
1199 value indicating an applied/deferred fix (-1, 0, 1), |
1564 <dd> |
1200 a message for the fix (string) and an ID for a deferred |
1565 value indicating an applied/deferred fix (-1, 0, 1), |
1201 fix (integer) |
1566 a message for the fix (string) and an ID for a deferred |
1202 </dd> |
1567 fix (integer) |
1203 </dl><a NAME="CodeStyleFixer.__fixE702" ID="CodeStyleFixer.__fixE702"></a> |
1568 </dd> |
|
1569 </dl> |
|
1570 <a NAME="CodeStyleFixer.__fixE702" ID="CodeStyleFixer.__fixE702"></a> |
1204 <h4>CodeStyleFixer.__fixE702</h4> |
1571 <h4>CodeStyleFixer.__fixE702</h4> |
1205 <b>__fixE702</b>(<i>code, line, pos, apply=False</i>) |
1572 <b>__fixE702</b>(<i>code, line, pos, apply=False</i>) |
|
1573 |
1206 <p> |
1574 <p> |
1207 Private method to fix semicolon-separated compound statements. |
1575 Private method to fix semicolon-separated compound statements. |
1208 </p><p> |
1576 </p> |
|
1577 <p> |
1209 Codes: E702, E703 |
1578 Codes: E702, E703 |
1210 </p><dl> |
1579 </p> |
1211 <dt><i>code</i></dt> |
1580 <dl> |
1212 <dd> |
1581 |
1213 code of the issue (string) |
1582 <dt><i>code</i></dt> |
1214 </dd><dt><i>line</i></dt> |
1583 <dd> |
1215 <dd> |
1584 code of the issue (string) |
1216 line number of the issue (integer) |
1585 </dd> |
1217 </dd><dt><i>pos</i></dt> |
1586 <dt><i>line</i></dt> |
1218 <dd> |
1587 <dd> |
1219 position inside line (integer) |
1588 line number of the issue (integer) |
1220 </dd><dt><i>apply=</i></dt> |
1589 </dd> |
|
1590 <dt><i>pos</i></dt> |
|
1591 <dd> |
|
1592 position inside line (integer) |
|
1593 </dd> |
|
1594 <dt><i>apply=</i></dt> |
1221 <dd> |
1595 <dd> |
1222 flag indicating, that the fix should be applied |
1596 flag indicating, that the fix should be applied |
1223 (boolean) |
1597 (boolean) |
1224 </dd> |
1598 </dd> |
1225 </dl><dl> |
1599 </dl> |
1226 <dt>Returns:</dt> |
1600 <dl> |
1227 <dd> |
1601 <dt>Returns:</dt> |
1228 value indicating an applied/deferred fix (-1, 0, 1), |
1602 <dd> |
1229 a message for the fix (string) and an ID for a deferred |
1603 value indicating an applied/deferred fix (-1, 0, 1), |
1230 fix (integer) |
1604 a message for the fix (string) and an ID for a deferred |
1231 </dd> |
1605 fix (integer) |
1232 </dl><a NAME="CodeStyleFixer.__fixE711" ID="CodeStyleFixer.__fixE711"></a> |
1606 </dd> |
|
1607 </dl> |
|
1608 <a NAME="CodeStyleFixer.__fixE711" ID="CodeStyleFixer.__fixE711"></a> |
1233 <h4>CodeStyleFixer.__fixE711</h4> |
1609 <h4>CodeStyleFixer.__fixE711</h4> |
1234 <b>__fixE711</b>(<i>code, line, pos</i>) |
1610 <b>__fixE711</b>(<i>code, line, pos</i>) |
|
1611 |
1235 <p> |
1612 <p> |
1236 Private method to fix comparison with None. |
1613 Private method to fix comparison with None. |
1237 </p><p> |
1614 </p> |
|
1615 <p> |
1238 Codes: E711, E712 |
1616 Codes: E711, E712 |
1239 </p><dl> |
1617 </p> |
1240 <dt><i>code</i></dt> |
1618 <dl> |
1241 <dd> |
1619 |
1242 code of the issue (string) |
1620 <dt><i>code</i></dt> |
1243 </dd><dt><i>line</i></dt> |
1621 <dd> |
1244 <dd> |
1622 code of the issue (string) |
1245 line number of the issue (integer) |
1623 </dd> |
1246 </dd><dt><i>pos</i></dt> |
1624 <dt><i>line</i></dt> |
1247 <dd> |
1625 <dd> |
1248 position inside line (integer) |
1626 line number of the issue (integer) |
1249 </dd> |
1627 </dd> |
1250 </dl><dl> |
1628 <dt><i>pos</i></dt> |
1251 <dt>Returns:</dt> |
1629 <dd> |
1252 <dd> |
1630 position inside line (integer) |
1253 value indicating an applied/deferred fix (-1, 0, 1), |
1631 </dd> |
1254 a message for the fix (string) and an ID for a deferred |
1632 </dl> |
1255 fix (integer) |
1633 <dl> |
1256 </dd> |
1634 <dt>Returns:</dt> |
1257 </dl><a NAME="CodeStyleFixer.__fixN804" ID="CodeStyleFixer.__fixN804"></a> |
1635 <dd> |
|
1636 value indicating an applied/deferred fix (-1, 0, 1), |
|
1637 a message for the fix (string) and an ID for a deferred |
|
1638 fix (integer) |
|
1639 </dd> |
|
1640 </dl> |
|
1641 <a NAME="CodeStyleFixer.__fixN804" ID="CodeStyleFixer.__fixN804"></a> |
1258 <h4>CodeStyleFixer.__fixN804</h4> |
1642 <h4>CodeStyleFixer.__fixN804</h4> |
1259 <b>__fixN804</b>(<i>code, line, pos, apply=False</i>) |
1643 <b>__fixN804</b>(<i>code, line, pos, apply=False</i>) |
|
1644 |
1260 <p> |
1645 <p> |
1261 Private method to fix a wrong first argument of normal and |
1646 Private method to fix a wrong first argument of normal and |
1262 class methods. |
1647 class methods. |
1263 </p><p> |
1648 </p> |
|
1649 <p> |
1264 Codes: N804, N805 |
1650 Codes: N804, N805 |
1265 </p><dl> |
1651 </p> |
1266 <dt><i>code</i></dt> |
1652 <dl> |
1267 <dd> |
1653 |
1268 code of the issue (string) |
1654 <dt><i>code</i></dt> |
1269 </dd><dt><i>line</i></dt> |
1655 <dd> |
1270 <dd> |
1656 code of the issue (string) |
1271 line number of the issue (integer) |
1657 </dd> |
1272 </dd><dt><i>pos</i></dt> |
1658 <dt><i>line</i></dt> |
1273 <dd> |
1659 <dd> |
1274 position inside line (integer) |
1660 line number of the issue (integer) |
1275 </dd><dt><i>apply=</i></dt> |
1661 </dd> |
|
1662 <dt><i>pos</i></dt> |
|
1663 <dd> |
|
1664 position inside line (integer) |
|
1665 </dd> |
|
1666 <dt><i>apply=</i></dt> |
1276 <dd> |
1667 <dd> |
1277 flag indicating, that the fix should be applied |
1668 flag indicating, that the fix should be applied |
1278 (boolean) |
1669 (boolean) |
1279 </dd> |
1670 </dd> |
1280 </dl><dl> |
1671 </dl> |
1281 <dt>Returns:</dt> |
1672 <dl> |
1282 <dd> |
1673 <dt>Returns:</dt> |
1283 value indicating an applied/deferred fix (-1, 0, 1), |
1674 <dd> |
1284 a message for the fix (string) and an ID for a deferred |
1675 value indicating an applied/deferred fix (-1, 0, 1), |
1285 fix (integer) |
1676 a message for the fix (string) and an ID for a deferred |
1286 </dd> |
1677 fix (integer) |
1287 </dl><a NAME="CodeStyleFixer.__fixN806" ID="CodeStyleFixer.__fixN806"></a> |
1678 </dd> |
|
1679 </dl> |
|
1680 <a NAME="CodeStyleFixer.__fixN806" ID="CodeStyleFixer.__fixN806"></a> |
1288 <h4>CodeStyleFixer.__fixN806</h4> |
1681 <h4>CodeStyleFixer.__fixN806</h4> |
1289 <b>__fixN806</b>(<i>code, line, pos, apply=False</i>) |
1682 <b>__fixN806</b>(<i>code, line, pos, apply=False</i>) |
|
1683 |
1290 <p> |
1684 <p> |
1291 Private method to fix a wrong first argument of static methods. |
1685 Private method to fix a wrong first argument of static methods. |
1292 </p><p> |
1686 </p> |
|
1687 <p> |
1293 Codes: N806 |
1688 Codes: N806 |
1294 </p><dl> |
1689 </p> |
1295 <dt><i>code</i></dt> |
1690 <dl> |
1296 <dd> |
1691 |
1297 code of the issue (string) |
1692 <dt><i>code</i></dt> |
1298 </dd><dt><i>line</i></dt> |
1693 <dd> |
1299 <dd> |
1694 code of the issue (string) |
1300 line number of the issue (integer) |
1695 </dd> |
1301 </dd><dt><i>pos</i></dt> |
1696 <dt><i>line</i></dt> |
1302 <dd> |
1697 <dd> |
1303 position inside line (integer) |
1698 line number of the issue (integer) |
1304 </dd><dt><i>apply=</i></dt> |
1699 </dd> |
|
1700 <dt><i>pos</i></dt> |
|
1701 <dd> |
|
1702 position inside line (integer) |
|
1703 </dd> |
|
1704 <dt><i>apply=</i></dt> |
1305 <dd> |
1705 <dd> |
1306 flag indicating, that the fix should be applied |
1706 flag indicating, that the fix should be applied |
1307 (boolean) |
1707 (boolean) |
1308 </dd> |
1708 </dd> |
1309 </dl><dl> |
1709 </dl> |
1310 <dt>Returns:</dt> |
1710 <dl> |
1311 <dd> |
1711 <dt>Returns:</dt> |
1312 value indicating an applied/deferred fix (-1, 0, 1), |
1712 <dd> |
1313 a message for the fix (string) and an ID for a deferred |
1713 value indicating an applied/deferred fix (-1, 0, 1), |
1314 fix (integer) |
1714 a message for the fix (string) and an ID for a deferred |
1315 </dd> |
1715 fix (integer) |
1316 </dl><a NAME="CodeStyleFixer.__fixReindent" ID="CodeStyleFixer.__fixReindent"></a> |
1716 </dd> |
|
1717 </dl> |
|
1718 <a NAME="CodeStyleFixer.__fixReindent" ID="CodeStyleFixer.__fixReindent"></a> |
1317 <h4>CodeStyleFixer.__fixReindent</h4> |
1719 <h4>CodeStyleFixer.__fixReindent</h4> |
1318 <b>__fixReindent</b>(<i>line, pos, logical</i>) |
1720 <b>__fixReindent</b>(<i>line, pos, logical</i>) |
|
1721 |
1319 <p> |
1722 <p> |
1320 Private method to fix a badly indented line. |
1723 Private method to fix a badly indented line. |
1321 </p><p> |
1724 </p> |
|
1725 <p> |
1322 This is done by adding or removing from its initial indent only. |
1726 This is done by adding or removing from its initial indent only. |
1323 </p><dl> |
1727 </p> |
1324 <dt><i>line</i></dt> |
1728 <dl> |
1325 <dd> |
1729 |
1326 line number of the issue (integer) |
1730 <dt><i>line</i></dt> |
1327 </dd><dt><i>pos</i></dt> |
1731 <dd> |
1328 <dd> |
1732 line number of the issue (integer) |
1329 position inside line (integer) |
1733 </dd> |
1330 </dd><dt><i>logical</i></dt> |
1734 <dt><i>pos</i></dt> |
|
1735 <dd> |
|
1736 position inside line (integer) |
|
1737 </dd> |
|
1738 <dt><i>logical</i></dt> |
1331 <dd> |
1739 <dd> |
1332 logical line structure |
1740 logical line structure |
1333 </dd> |
1741 </dd> |
1334 </dl><dl> |
1742 </dl> |
|
1743 <dl> |
1335 <dt>Returns:</dt> |
1744 <dt>Returns:</dt> |
1336 <dd> |
1745 <dd> |
1337 flag indicating a change was done (boolean) |
1746 flag indicating a change was done (boolean) |
1338 </dd> |
1747 </dd> |
1339 </dl><a NAME="CodeStyleFixer.__fixW291" ID="CodeStyleFixer.__fixW291"></a> |
1748 </dl> |
|
1749 <a NAME="CodeStyleFixer.__fixW291" ID="CodeStyleFixer.__fixW291"></a> |
1340 <h4>CodeStyleFixer.__fixW291</h4> |
1750 <h4>CodeStyleFixer.__fixW291</h4> |
1341 <b>__fixW291</b>(<i>code, line, pos</i>) |
1751 <b>__fixW291</b>(<i>code, line, pos</i>) |
|
1752 |
1342 <p> |
1753 <p> |
1343 Private method to fix trailing whitespace. |
1754 Private method to fix trailing whitespace. |
1344 </p><p> |
1755 </p> |
|
1756 <p> |
1345 Codes: W291, W293 |
1757 Codes: W291, W293 |
1346 </p><dl> |
1758 </p> |
1347 <dt><i>code</i></dt> |
1759 <dl> |
1348 <dd> |
1760 |
1349 code of the issue (string) |
1761 <dt><i>code</i></dt> |
1350 </dd><dt><i>line</i></dt> |
1762 <dd> |
1351 <dd> |
1763 code of the issue (string) |
1352 line number of the issue (integer) |
1764 </dd> |
1353 </dd><dt><i>pos</i></dt> |
1765 <dt><i>line</i></dt> |
1354 <dd> |
1766 <dd> |
1355 position inside line (integer) |
1767 line number of the issue (integer) |
1356 </dd> |
1768 </dd> |
1357 </dl><dl> |
1769 <dt><i>pos</i></dt> |
1358 <dt>Returns:</dt> |
1770 <dd> |
1359 <dd> |
1771 position inside line (integer) |
1360 value indicating an applied/deferred fix (-1, 0, 1), |
1772 </dd> |
1361 a message for the fix (string) and an ID for a deferred |
1773 </dl> |
1362 fix (integer) |
1774 <dl> |
1363 </dd> |
1775 <dt>Returns:</dt> |
1364 </dl><a NAME="CodeStyleFixer.__fixW292" ID="CodeStyleFixer.__fixW292"></a> |
1776 <dd> |
|
1777 value indicating an applied/deferred fix (-1, 0, 1), |
|
1778 a message for the fix (string) and an ID for a deferred |
|
1779 fix (integer) |
|
1780 </dd> |
|
1781 </dl> |
|
1782 <a NAME="CodeStyleFixer.__fixW292" ID="CodeStyleFixer.__fixW292"></a> |
1365 <h4>CodeStyleFixer.__fixW292</h4> |
1783 <h4>CodeStyleFixer.__fixW292</h4> |
1366 <b>__fixW292</b>(<i>code, line, pos</i>) |
1784 <b>__fixW292</b>(<i>code, line, pos</i>) |
|
1785 |
1367 <p> |
1786 <p> |
1368 Private method to fix a missing newline at the end of file. |
1787 Private method to fix a missing newline at the end of file. |
1369 </p><p> |
1788 </p> |
|
1789 <p> |
1370 Codes: W292 |
1790 Codes: W292 |
1371 </p><dl> |
1791 </p> |
1372 <dt><i>code</i></dt> |
1792 <dl> |
1373 <dd> |
1793 |
1374 code of the issue (string) |
1794 <dt><i>code</i></dt> |
1375 </dd><dt><i>line</i></dt> |
1795 <dd> |
1376 <dd> |
1796 code of the issue (string) |
1377 line number of the issue (integer) |
1797 </dd> |
1378 </dd><dt><i>pos</i></dt> |
1798 <dt><i>line</i></dt> |
1379 <dd> |
1799 <dd> |
1380 position inside line (integer) |
1800 line number of the issue (integer) |
1381 </dd> |
1801 </dd> |
1382 </dl><dl> |
1802 <dt><i>pos</i></dt> |
1383 <dt>Returns:</dt> |
1803 <dd> |
1384 <dd> |
1804 position inside line (integer) |
1385 value indicating an applied/deferred fix (-1, 0, 1), |
1805 </dd> |
1386 a message for the fix (string) and an ID for a deferred |
1806 </dl> |
1387 fix (integer) |
1807 <dl> |
1388 </dd> |
1808 <dt>Returns:</dt> |
1389 </dl><a NAME="CodeStyleFixer.__fixW391" ID="CodeStyleFixer.__fixW391"></a> |
1809 <dd> |
|
1810 value indicating an applied/deferred fix (-1, 0, 1), |
|
1811 a message for the fix (string) and an ID for a deferred |
|
1812 fix (integer) |
|
1813 </dd> |
|
1814 </dl> |
|
1815 <a NAME="CodeStyleFixer.__fixW391" ID="CodeStyleFixer.__fixW391"></a> |
1390 <h4>CodeStyleFixer.__fixW391</h4> |
1816 <h4>CodeStyleFixer.__fixW391</h4> |
1391 <b>__fixW391</b>(<i>code, line, pos</i>) |
1817 <b>__fixW391</b>(<i>code, line, pos</i>) |
|
1818 |
1392 <p> |
1819 <p> |
1393 Private method to fix trailing blank lines. |
1820 Private method to fix trailing blank lines. |
1394 </p><p> |
1821 </p> |
|
1822 <p> |
1395 Codes: W391 |
1823 Codes: W391 |
1396 </p><dl> |
1824 </p> |
1397 <dt><i>code</i></dt> |
1825 <dl> |
1398 <dd> |
1826 |
1399 code of the issue (string) |
1827 <dt><i>code</i></dt> |
1400 </dd><dt><i>line</i></dt> |
1828 <dd> |
1401 <dd> |
1829 code of the issue (string) |
1402 line number of the issue (integer) |
1830 </dd> |
1403 </dd><dt><i>pos</i></dt> |
1831 <dt><i>line</i></dt> |
1404 <dd> |
1832 <dd> |
1405 position inside line (integer) |
1833 line number of the issue (integer) |
1406 </dd> |
1834 </dd> |
1407 </dl><dl> |
1835 <dt><i>pos</i></dt> |
1408 <dt>Returns:</dt> |
1836 <dd> |
1409 <dd> |
1837 position inside line (integer) |
1410 value indicating an applied/deferred fix (-1, 0, 1), |
1838 </dd> |
1411 a message for the fix (string) and an ID for a deferred |
1839 </dl> |
1412 fix (integer) |
1840 <dl> |
1413 </dd> |
1841 <dt>Returns:</dt> |
1414 </dl><a NAME="CodeStyleFixer.__fixW603" ID="CodeStyleFixer.__fixW603"></a> |
1842 <dd> |
|
1843 value indicating an applied/deferred fix (-1, 0, 1), |
|
1844 a message for the fix (string) and an ID for a deferred |
|
1845 fix (integer) |
|
1846 </dd> |
|
1847 </dl> |
|
1848 <a NAME="CodeStyleFixer.__fixW603" ID="CodeStyleFixer.__fixW603"></a> |
1415 <h4>CodeStyleFixer.__fixW603</h4> |
1849 <h4>CodeStyleFixer.__fixW603</h4> |
1416 <b>__fixW603</b>(<i>code, line, pos</i>) |
1850 <b>__fixW603</b>(<i>code, line, pos</i>) |
|
1851 |
1417 <p> |
1852 <p> |
1418 Private method to fix the not equal notation. |
1853 Private method to fix the not equal notation. |
1419 </p><p> |
1854 </p> |
|
1855 <p> |
1420 Codes: W603 |
1856 Codes: W603 |
1421 </p><dl> |
1857 </p> |
1422 <dt><i>code</i></dt> |
1858 <dl> |
1423 <dd> |
1859 |
1424 code of the issue (string) |
1860 <dt><i>code</i></dt> |
1425 </dd><dt><i>line</i></dt> |
1861 <dd> |
1426 <dd> |
1862 code of the issue (string) |
1427 line number of the issue (integer) |
1863 </dd> |
1428 </dd><dt><i>pos</i></dt> |
1864 <dt><i>line</i></dt> |
1429 <dd> |
1865 <dd> |
1430 position inside line (integer) |
1866 line number of the issue (integer) |
1431 </dd> |
1867 </dd> |
1432 </dl><dl> |
1868 <dt><i>pos</i></dt> |
1433 <dt>Returns:</dt> |
1869 <dd> |
1434 <dd> |
1870 position inside line (integer) |
1435 value indicating an applied/deferred fix (-1, 0, 1), |
1871 </dd> |
1436 a message for the fix (string) and an ID for a deferred |
1872 </dl> |
1437 fix (integer) |
1873 <dl> |
1438 </dd> |
1874 <dt>Returns:</dt> |
1439 </dl><a NAME="CodeStyleFixer.__fixWhitespace" ID="CodeStyleFixer.__fixWhitespace"></a> |
1875 <dd> |
|
1876 value indicating an applied/deferred fix (-1, 0, 1), |
|
1877 a message for the fix (string) and an ID for a deferred |
|
1878 fix (integer) |
|
1879 </dd> |
|
1880 </dl> |
|
1881 <a NAME="CodeStyleFixer.__fixWhitespace" ID="CodeStyleFixer.__fixWhitespace"></a> |
1440 <h4>CodeStyleFixer.__fixWhitespace</h4> |
1882 <h4>CodeStyleFixer.__fixWhitespace</h4> |
1441 <b>__fixWhitespace</b>(<i>line, offset, replacement</i>) |
1883 <b>__fixWhitespace</b>(<i>line, offset, replacement</i>) |
|
1884 |
1442 <p> |
1885 <p> |
1443 Private method to correct whitespace at the given offset. |
1886 Private method to correct whitespace at the given offset. |
1444 </p><dl> |
1887 </p> |
|
1888 <dl> |
|
1889 |
1445 <dt><i>line</i></dt> |
1890 <dt><i>line</i></dt> |
1446 <dd> |
1891 <dd> |
1447 line to be corrected (string) |
1892 line to be corrected (string) |
1448 </dd><dt><i>offset</i></dt> |
1893 </dd> |
|
1894 <dt><i>offset</i></dt> |
1449 <dd> |
1895 <dd> |
1450 offset within line (integer) |
1896 offset within line (integer) |
1451 </dd><dt><i>replacement</i></dt> |
1897 </dd> |
|
1898 <dt><i>replacement</i></dt> |
1452 <dd> |
1899 <dd> |
1453 replacement string (string) |
1900 replacement string (string) |
1454 </dd> |
1901 </dd> |
1455 </dl><dl> |
1902 </dl> |
|
1903 <dl> |
1456 <dt>Returns:</dt> |
1904 <dt>Returns:</dt> |
1457 <dd> |
1905 <dd> |
1458 corrected line |
1906 corrected line |
1459 </dd> |
1907 </dd> |
1460 </dl><a NAME="CodeStyleFixer.__getID" ID="CodeStyleFixer.__getID"></a> |
1908 </dl> |
|
1909 <a NAME="CodeStyleFixer.__getID" ID="CodeStyleFixer.__getID"></a> |
1461 <h4>CodeStyleFixer.__getID</h4> |
1910 <h4>CodeStyleFixer.__getID</h4> |
1462 <b>__getID</b>(<i></i>) |
1911 <b>__getID</b>(<i></i>) |
|
1912 |
1463 <p> |
1913 <p> |
1464 Private method to get the ID for a deferred fix. |
1914 Private method to get the ID for a deferred fix. |
1465 </p><dl> |
1915 </p> |
|
1916 <dl> |
1466 <dt>Returns:</dt> |
1917 <dt>Returns:</dt> |
1467 <dd> |
1918 <dd> |
1468 ID for a deferred fix (integer) |
1919 ID for a deferred fix (integer) |
1469 </dd> |
1920 </dd> |
1470 </dl><a NAME="CodeStyleFixer.__getIndent" ID="CodeStyleFixer.__getIndent"></a> |
1921 </dl> |
|
1922 <a NAME="CodeStyleFixer.__getIndent" ID="CodeStyleFixer.__getIndent"></a> |
1471 <h4>CodeStyleFixer.__getIndent</h4> |
1923 <h4>CodeStyleFixer.__getIndent</h4> |
1472 <b>__getIndent</b>(<i>line</i>) |
1924 <b>__getIndent</b>(<i>line</i>) |
|
1925 |
1473 <p> |
1926 <p> |
1474 Private method to get the indentation string. |
1927 Private method to get the indentation string. |
1475 </p><dl> |
1928 </p> |
|
1929 <dl> |
|
1930 |
1476 <dt><i>line</i></dt> |
1931 <dt><i>line</i></dt> |
1477 <dd> |
1932 <dd> |
1478 line to determine the indentation string from (string) |
1933 line to determine the indentation string from (string) |
1479 </dd> |
1934 </dd> |
1480 </dl><dl> |
1935 </dl> |
|
1936 <dl> |
1481 <dt>Returns:</dt> |
1937 <dt>Returns:</dt> |
1482 <dd> |
1938 <dd> |
1483 indentation string (string) |
1939 indentation string (string) |
1484 </dd> |
1940 </dd> |
1485 </dl><a NAME="CodeStyleFixer.__getIndentWord" ID="CodeStyleFixer.__getIndentWord"></a> |
1941 </dl> |
|
1942 <a NAME="CodeStyleFixer.__getIndentWord" ID="CodeStyleFixer.__getIndentWord"></a> |
1486 <h4>CodeStyleFixer.__getIndentWord</h4> |
1943 <h4>CodeStyleFixer.__getIndentWord</h4> |
1487 <b>__getIndentWord</b>(<i></i>) |
1944 <b>__getIndentWord</b>(<i></i>) |
|
1945 |
1488 <p> |
1946 <p> |
1489 Private method to determine the indentation type. |
1947 Private method to determine the indentation type. |
1490 </p><dl> |
1948 </p> |
|
1949 <dl> |
1491 <dt>Returns:</dt> |
1950 <dt>Returns:</dt> |
1492 <dd> |
1951 <dd> |
1493 string to be used for an indentation (string) |
1952 string to be used for an indentation (string) |
1494 </dd> |
1953 </dd> |
1495 </dl><a NAME="CodeStyleFixer.__getLogical" ID="CodeStyleFixer.__getLogical"></a> |
1954 </dl> |
|
1955 <a NAME="CodeStyleFixer.__getLogical" ID="CodeStyleFixer.__getLogical"></a> |
1496 <h4>CodeStyleFixer.__getLogical</h4> |
1956 <h4>CodeStyleFixer.__getLogical</h4> |
1497 <b>__getLogical</b>(<i>line, pos</i>) |
1957 <b>__getLogical</b>(<i>line, pos</i>) |
|
1958 |
1498 <p> |
1959 <p> |
1499 Private method to get the logical line corresponding to the given |
1960 Private method to get the logical line corresponding to the given |
1500 position. |
1961 position. |
1501 </p><dl> |
1962 </p> |
1502 <dt><i>line</i></dt> |
1963 <dl> |
1503 <dd> |
1964 |
1504 line number of the issue (integer) |
1965 <dt><i>line</i></dt> |
1505 </dd><dt><i>pos</i></dt> |
1966 <dd> |
1506 <dd> |
1967 line number of the issue (integer) |
1507 position inside line (integer) |
1968 </dd> |
1508 </dd> |
1969 <dt><i>pos</i></dt> |
1509 </dl><dl> |
1970 <dd> |
|
1971 position inside line (integer) |
|
1972 </dd> |
|
1973 </dl> |
|
1974 <dl> |
1510 <dt>Returns:</dt> |
1975 <dt>Returns:</dt> |
1511 <dd> |
1976 <dd> |
1512 tuple of a tuple of two integers giving the start of the |
1977 tuple of a tuple of two integers giving the start of the |
1513 logical line, another tuple of two integers giving the end |
1978 logical line, another tuple of two integers giving the end |
1514 of the logical line and a list of strings with the original |
1979 of the logical line and a list of strings with the original |
1515 source lines |
1980 source lines |
1516 </dd> |
1981 </dd> |
1517 </dl><a NAME="CodeStyleFixer.__multilineStringLines" ID="CodeStyleFixer.__multilineStringLines"></a> |
1982 </dl> |
|
1983 <a NAME="CodeStyleFixer.__multilineStringLines" ID="CodeStyleFixer.__multilineStringLines"></a> |
1518 <h4>CodeStyleFixer.__multilineStringLines</h4> |
1984 <h4>CodeStyleFixer.__multilineStringLines</h4> |
1519 <b>__multilineStringLines</b>(<i></i>) |
1985 <b>__multilineStringLines</b>(<i></i>) |
|
1986 |
1520 <p> |
1987 <p> |
1521 Private method to determine the line numbers that are within multi line |
1988 Private method to determine the line numbers that are within multi line |
1522 strings and these which are part of a documentation string. |
1989 strings and these which are part of a documentation string. |
1523 </p><dl> |
1990 </p> |
|
1991 <dl> |
1524 <dt>Returns:</dt> |
1992 <dt>Returns:</dt> |
1525 <dd> |
1993 <dd> |
1526 tuple of a set of line numbers belonging to a multi line |
1994 tuple of a set of line numbers belonging to a multi line |
1527 string and a set of line numbers belonging to a multi line |
1995 string and a set of line numbers belonging to a multi line |
1528 documentation string (tuple of two set of integer) |
1996 documentation string (tuple of two set of integer) |
1529 </dd> |
1997 </dd> |
1530 </dl><a NAME="CodeStyleFixer.finalize" ID="CodeStyleFixer.finalize"></a> |
1998 </dl> |
|
1999 <a NAME="CodeStyleFixer.finalize" ID="CodeStyleFixer.finalize"></a> |
1531 <h4>CodeStyleFixer.finalize</h4> |
2000 <h4>CodeStyleFixer.finalize</h4> |
1532 <b>finalize</b>(<i></i>) |
2001 <b>finalize</b>(<i></i>) |
|
2002 |
1533 <p> |
2003 <p> |
1534 Public method to apply all deferred fixes. |
2004 Public method to apply all deferred fixes. |
1535 </p><dl> |
2005 </p> |
|
2006 <dl> |
1536 <dt>Returns:</dt> |
2007 <dt>Returns:</dt> |
1537 <dd> |
2008 <dd> |
1538 dictionary containing the fix results |
2009 dictionary containing the fix results |
1539 </dd> |
2010 </dd> |
1540 </dl><a NAME="CodeStyleFixer.fixIssue" ID="CodeStyleFixer.fixIssue"></a> |
2011 </dl> |
|
2012 <a NAME="CodeStyleFixer.fixIssue" ID="CodeStyleFixer.fixIssue"></a> |
1541 <h4>CodeStyleFixer.fixIssue</h4> |
2013 <h4>CodeStyleFixer.fixIssue</h4> |
1542 <b>fixIssue</b>(<i>line, pos, message</i>) |
2014 <b>fixIssue</b>(<i>line, pos, message</i>) |
|
2015 |
1543 <p> |
2016 <p> |
1544 Public method to fix the fixable issues. |
2017 Public method to fix the fixable issues. |
1545 </p><dl> |
2018 </p> |
|
2019 <dl> |
|
2020 |
1546 <dt><i>line</i></dt> |
2021 <dt><i>line</i></dt> |
1547 <dd> |
2022 <dd> |
1548 line number of issue (integer) |
2023 line number of issue (integer) |
1549 </dd><dt><i>pos</i></dt> |
2024 </dd> |
|
2025 <dt><i>pos</i></dt> |
1550 <dd> |
2026 <dd> |
1551 character position of issue (integer) |
2027 character position of issue (integer) |
1552 </dd><dt><i>message</i></dt> |
2028 </dd> |
|
2029 <dt><i>message</i></dt> |
1553 <dd> |
2030 <dd> |
1554 message text (string) |
2031 message text (string) |
1555 </dd> |
2032 </dd> |
1556 </dl><dl> |
2033 </dl> |
1557 <dt>Returns:</dt> |
2034 <dl> |
1558 <dd> |
2035 <dt>Returns:</dt> |
1559 value indicating an applied/deferred fix (-1, 0, 1), |
2036 <dd> |
1560 a message for the fix (string) and an ID for a deferred |
2037 value indicating an applied/deferred fix (-1, 0, 1), |
1561 fix (integer) |
2038 a message for the fix (string) and an ID for a deferred |
1562 </dd> |
2039 fix (integer) |
1563 </dl><a NAME="CodeStyleFixer.mutualStartswith" ID="CodeStyleFixer.mutualStartswith"></a> |
2040 </dd> |
|
2041 </dl> |
|
2042 <a NAME="CodeStyleFixer.mutualStartswith" ID="CodeStyleFixer.mutualStartswith"></a> |
1564 <h4>CodeStyleFixer.mutualStartswith</h4> |
2043 <h4>CodeStyleFixer.mutualStartswith</h4> |
1565 <b>mutualStartswith</b>(<i>b</i>) |
2044 <b>mutualStartswith</b>(<i>b</i>) |
|
2045 |
1566 <p> |
2046 <p> |
1567 Local helper method to compare the beginnings of two strings |
2047 Local helper method to compare the beginnings of two strings |
1568 against each other. |
2048 against each other. |
1569 </p><dl> |
2049 </p> |
|
2050 <dl> |
1570 <dt>Returns:</dt> |
2051 <dt>Returns:</dt> |
1571 <dd> |
2052 <dd> |
1572 flag indicating that one string starts with the other |
2053 flag indicating that one string starts with the other |
1573 (boolean) |
2054 (boolean) |
1574 </dd> |
2055 </dd> |
1575 </dl><a NAME="CodeStyleFixer.saveFile" ID="CodeStyleFixer.saveFile"></a> |
2056 </dl> |
|
2057 <a NAME="CodeStyleFixer.saveFile" ID="CodeStyleFixer.saveFile"></a> |
1576 <h4>CodeStyleFixer.saveFile</h4> |
2058 <h4>CodeStyleFixer.saveFile</h4> |
1577 <b>saveFile</b>(<i>encoding</i>) |
2059 <b>saveFile</b>(<i>encoding</i>) |
|
2060 |
1578 <p> |
2061 <p> |
1579 Public method to save the modified file. |
2062 Public method to save the modified file. |
1580 </p><dl> |
2063 </p> |
|
2064 <dl> |
|
2065 |
1581 <dt><i>encoding</i></dt> |
2066 <dt><i>encoding</i></dt> |
1582 <dd> |
2067 <dd> |
1583 encoding of the source file (string) |
2068 encoding of the source file (string) |
1584 </dd> |
2069 </dd> |
1585 </dl><dl> |
2070 </dl> |
|
2071 <dl> |
1586 <dt>Returns:</dt> |
2072 <dt>Returns:</dt> |
1587 <dd> |
2073 <dd> |
1588 error message on failure (tuple of str) |
2074 error message on failure (tuple of str) |
1589 </dd> |
2075 </dd> |
1590 </dl> |
2076 </dl> |
1591 <div align="right"><a href="#top">Up</a></div> |
2077 <div align="right"><a href="#top">Up</a></div> |
1592 <hr /><hr /> |
2078 <hr /> |
|
2079 <hr /> |
1593 <a NAME="IndentationWrapper" ID="IndentationWrapper"></a> |
2080 <a NAME="IndentationWrapper" ID="IndentationWrapper"></a> |
1594 <h2>IndentationWrapper</h2> |
2081 <h2>IndentationWrapper</h2> |
|
2082 |
1595 <p> |
2083 <p> |
1596 Class used by fixers dealing with indentation. |
2084 Class used by fixers dealing with indentation. |
1597 </p><p> |
2085 </p> |
|
2086 <p> |
1598 Each instance operates on a single logical line. |
2087 Each instance operates on a single logical line. |
1599 </p> |
2088 </p> |
1600 <h3>Derived from</h3> |
2089 <h3>Derived from</h3> |
1601 object |
2090 object |
1602 <h3>Class Attributes</h3> |
2091 <h3>Class Attributes</h3> |
|
2092 |
1603 <table> |
2093 <table> |
1604 <tr><td>SKIP_TOKENS</td></tr> |
2094 <tr><td>SKIP_TOKENS</td></tr> |
1605 </table> |
2095 </table> |
1606 <h3>Class Methods</h3> |
2096 <h3>Class Methods</h3> |
|
2097 |
1607 <table> |
2098 <table> |
1608 <tr><td>None</td></tr> |
2099 <tr><td>None</td></tr> |
1609 </table> |
2100 </table> |
1610 <h3>Methods</h3> |
2101 <h3>Methods</h3> |
|
2102 |
1611 <table> |
2103 <table> |
|
2104 |
1612 <tr> |
2105 <tr> |
1613 <td><a href="#IndentationWrapper.__init__">IndentationWrapper</a></td> |
2106 <td><a href="#IndentationWrapper.__init__">IndentationWrapper</a></td> |
1614 <td>Constructor</td> |
2107 <td>Constructor</td> |
1615 </tr><tr> |
2108 </tr> |
|
2109 <tr> |
1616 <td><a href="#IndentationWrapper.__buildTokensLogical">__buildTokensLogical</a></td> |
2110 <td><a href="#IndentationWrapper.__buildTokensLogical">__buildTokensLogical</a></td> |
1617 <td>Private method to build a logical line from a list of tokens.</td> |
2111 <td>Private method to build a logical line from a list of tokens.</td> |
1618 </tr><tr> |
2112 </tr> |
|
2113 <tr> |
1619 <td><a href="#IndentationWrapper.pep8Expected">pep8Expected</a></td> |
2114 <td><a href="#IndentationWrapper.pep8Expected">pep8Expected</a></td> |
1620 <td>Public method to replicate logic in pycodestyle.py, to know what level to indent things to.</td> |
2115 <td>Public method to replicate logic in pycodestyle.py, to know what level to indent things to.</td> |
1621 </tr> |
2116 </tr> |
1622 </table> |
2117 </table> |
1623 <h3>Static Methods</h3> |
2118 <h3>Static Methods</h3> |
|
2119 |
1624 <table> |
2120 <table> |
1625 <tr><td>None</td></tr> |
2121 <tr><td>None</td></tr> |
1626 </table> |
2122 </table> |
|
2123 |
1627 <a NAME="IndentationWrapper.__init__" ID="IndentationWrapper.__init__"></a> |
2124 <a NAME="IndentationWrapper.__init__" ID="IndentationWrapper.__init__"></a> |
1628 <h4>IndentationWrapper (Constructor)</h4> |
2125 <h4>IndentationWrapper (Constructor)</h4> |
1629 <b>IndentationWrapper</b>(<i>physical_lines</i>) |
2126 <b>IndentationWrapper</b>(<i>physical_lines</i>) |
|
2127 |
1630 <p> |
2128 <p> |
1631 Constructor |
2129 Constructor |
1632 </p><dl> |
2130 </p> |
|
2131 <dl> |
|
2132 |
1633 <dt><i>physical_lines</i></dt> |
2133 <dt><i>physical_lines</i></dt> |
1634 <dd> |
2134 <dd> |
1635 list of physical lines to operate on |
2135 list of physical lines to operate on |
1636 (list of strings) |
2136 (list of strings) |
1637 </dd> |
2137 </dd> |
1638 </dl><a NAME="IndentationWrapper.__buildTokensLogical" ID="IndentationWrapper.__buildTokensLogical"></a> |
2138 </dl> |
|
2139 <a NAME="IndentationWrapper.__buildTokensLogical" ID="IndentationWrapper.__buildTokensLogical"></a> |
1639 <h4>IndentationWrapper.__buildTokensLogical</h4> |
2140 <h4>IndentationWrapper.__buildTokensLogical</h4> |
1640 <b>__buildTokensLogical</b>(<i>tokens</i>) |
2141 <b>__buildTokensLogical</b>(<i>tokens</i>) |
|
2142 |
1641 <p> |
2143 <p> |
1642 Private method to build a logical line from a list of tokens. |
2144 Private method to build a logical line from a list of tokens. |
1643 </p><dl> |
2145 </p> |
|
2146 <dl> |
|
2147 |
1644 <dt><i>tokens</i></dt> |
2148 <dt><i>tokens</i></dt> |
1645 <dd> |
2149 <dd> |
1646 list of tokens as generated by tokenize.generate_tokens |
2150 list of tokens as generated by tokenize.generate_tokens |
1647 </dd> |
2151 </dd> |
1648 </dl><dl> |
2152 </dl> |
|
2153 <dl> |
1649 <dt>Returns:</dt> |
2154 <dt>Returns:</dt> |
1650 <dd> |
2155 <dd> |
1651 logical line (string) |
2156 logical line (string) |
1652 </dd> |
2157 </dd> |
1653 </dl><a NAME="IndentationWrapper.pep8Expected" ID="IndentationWrapper.pep8Expected"></a> |
2158 </dl> |
|
2159 <a NAME="IndentationWrapper.pep8Expected" ID="IndentationWrapper.pep8Expected"></a> |
1654 <h4>IndentationWrapper.pep8Expected</h4> |
2160 <h4>IndentationWrapper.pep8Expected</h4> |
1655 <b>pep8Expected</b>(<i></i>) |
2161 <b>pep8Expected</b>(<i></i>) |
|
2162 |
1656 <p> |
2163 <p> |
1657 Public method to replicate logic in pycodestyle.py, to know what level |
2164 Public method to replicate logic in pycodestyle.py, to know what level |
1658 to indent things to. |
2165 to indent things to. |
1659 </p><dl> |
2166 </p> |
|
2167 <dl> |
1660 <dt>Returns:</dt> |
2168 <dt>Returns:</dt> |
1661 <dd> |
2169 <dd> |
1662 list of lists, where each list represents valid indent levels |
2170 list of lists, where each list represents valid indent levels |
1663 for the line in question, relative from the initial indent. However, |
2171 for the line in question, relative from the initial indent. However, |
1664 the first entry is the indent level which was expected. |
2172 the first entry is the indent level which was expected. |
1665 </dd> |
2173 </dd> |
1666 </dl> |
2174 </dl> |
1667 <div align="right"><a href="#top">Up</a></div> |
2175 <div align="right"><a href="#top">Up</a></div> |
1668 <hr /><hr /> |
2176 <hr /> |
|
2177 <hr /> |
1669 <a NAME="LineShortener" ID="LineShortener"></a> |
2178 <a NAME="LineShortener" ID="LineShortener"></a> |
1670 <h2>LineShortener</h2> |
2179 <h2>LineShortener</h2> |
|
2180 |
1671 <p> |
2181 <p> |
1672 Class used to shorten lines to a given maximum of characters. |
2182 Class used to shorten lines to a given maximum of characters. |
1673 </p> |
2183 </p> |
1674 <h3>Derived from</h3> |
2184 <h3>Derived from</h3> |
1675 object |
2185 object |
1676 <h3>Class Attributes</h3> |
2186 <h3>Class Attributes</h3> |
|
2187 |
1677 <table> |
2188 <table> |
1678 <tr><td>None</td></tr> |
2189 <tr><td>None</td></tr> |
1679 </table> |
2190 </table> |
1680 <h3>Class Methods</h3> |
2191 <h3>Class Methods</h3> |
|
2192 |
1681 <table> |
2193 <table> |
1682 <tr><td>None</td></tr> |
2194 <tr><td>None</td></tr> |
1683 </table> |
2195 </table> |
1684 <h3>Methods</h3> |
2196 <h3>Methods</h3> |
|
2197 |
1685 <table> |
2198 <table> |
|
2199 |
1686 <tr> |
2200 <tr> |
1687 <td><a href="#LineShortener.__init__">LineShortener</a></td> |
2201 <td><a href="#LineShortener.__init__">LineShortener</a></td> |
1688 <td>Constructor</td> |
2202 <td>Constructor</td> |
1689 </tr><tr> |
2203 </tr> |
|
2204 <tr> |
1690 <td><a href="#LineShortener.__breakMultiline">__breakMultiline</a></td> |
2205 <td><a href="#LineShortener.__breakMultiline">__breakMultiline</a></td> |
1691 <td>Private method to break multi line strings.</td> |
2206 <td>Private method to break multi line strings.</td> |
1692 </tr><tr> |
2207 </tr> |
|
2208 <tr> |
1693 <td><a href="#LineShortener.__checkSyntax">__checkSyntax</a></td> |
2209 <td><a href="#LineShortener.__checkSyntax">__checkSyntax</a></td> |
1694 <td>Private method to check the syntax of the given code fragment.</td> |
2210 <td>Private method to check the syntax of the given code fragment.</td> |
1695 </tr><tr> |
2211 </tr> |
|
2212 <tr> |
1696 <td><a href="#LineShortener.__countUnbalancedBrackets">__countUnbalancedBrackets</a></td> |
2213 <td><a href="#LineShortener.__countUnbalancedBrackets">__countUnbalancedBrackets</a></td> |
1697 <td>Private method to determine the number of unmatched open/close brackets.</td> |
2214 <td>Private method to determine the number of unmatched open/close brackets.</td> |
1698 </tr><tr> |
2215 </tr> |
|
2216 <tr> |
1699 <td><a href="#LineShortener.__getIndent">__getIndent</a></td> |
2217 <td><a href="#LineShortener.__getIndent">__getIndent</a></td> |
1700 <td>Private method to get the indentation string.</td> |
2218 <td>Private method to get the indentation string.</td> |
1701 </tr><tr> |
2219 </tr> |
|
2220 <tr> |
1702 <td><a href="#LineShortener.__isProbablyInsideStringOrComment">__isProbablyInsideStringOrComment</a></td> |
2221 <td><a href="#LineShortener.__isProbablyInsideStringOrComment">__isProbablyInsideStringOrComment</a></td> |
1703 <td>Private method to check, if the given string might be inside a string or comment.</td> |
2222 <td>Private method to check, if the given string might be inside a string or comment.</td> |
1704 </tr><tr> |
2223 </tr> |
|
2224 <tr> |
1705 <td><a href="#LineShortener.__lineShorteningRank">__lineShorteningRank</a></td> |
2225 <td><a href="#LineShortener.__lineShorteningRank">__lineShorteningRank</a></td> |
1706 <td>Private method to rank a candidate.</td> |
2226 <td>Private method to rank a candidate.</td> |
1707 </tr><tr> |
2227 </tr> |
|
2228 <tr> |
1708 <td><a href="#LineShortener.__normalizeMultiline">__normalizeMultiline</a></td> |
2229 <td><a href="#LineShortener.__normalizeMultiline">__normalizeMultiline</a></td> |
1709 <td>Private method to remove multiline-related code that will cause syntax error.</td> |
2230 <td>Private method to remove multiline-related code that will cause syntax error.</td> |
1710 </tr><tr> |
2231 </tr> |
|
2232 <tr> |
1711 <td><a href="#LineShortener.__shortenComment">__shortenComment</a></td> |
2233 <td><a href="#LineShortener.__shortenComment">__shortenComment</a></td> |
1712 <td>Private method to shorten a comment line.</td> |
2234 <td>Private method to shorten a comment line.</td> |
1713 </tr><tr> |
2235 </tr> |
|
2236 <tr> |
1714 <td><a href="#LineShortener.__shortenLine">__shortenLine</a></td> |
2237 <td><a href="#LineShortener.__shortenLine">__shortenLine</a></td> |
1715 <td>Private method to shorten a line of code at an operator.</td> |
2238 <td>Private method to shorten a line of code at an operator.</td> |
1716 </tr><tr> |
2239 </tr> |
|
2240 <tr> |
1717 <td><a href="#LineShortener.shorten">shorten</a></td> |
2241 <td><a href="#LineShortener.shorten">shorten</a></td> |
1718 <td>Public method to shorten the line wrapped by the class instance.</td> |
2242 <td>Public method to shorten the line wrapped by the class instance.</td> |
1719 </tr> |
2243 </tr> |
1720 </table> |
2244 </table> |
1721 <h3>Static Methods</h3> |
2245 <h3>Static Methods</h3> |
|
2246 |
1722 <table> |
2247 <table> |
1723 <tr><td>None</td></tr> |
2248 <tr><td>None</td></tr> |
1724 </table> |
2249 </table> |
|
2250 |
1725 <a NAME="LineShortener.__init__" ID="LineShortener.__init__"></a> |
2251 <a NAME="LineShortener.__init__" ID="LineShortener.__init__"></a> |
1726 <h4>LineShortener (Constructor)</h4> |
2252 <h4>LineShortener (Constructor)</h4> |
1727 <b>LineShortener</b>(<i>curLine, prevLine, nextLine, maxLength=79, eol="\n", indentWord=" ", isDocString=False</i>) |
2253 <b>LineShortener</b>(<i>curLine, prevLine, nextLine, maxLength=79, eol="\n", indentWord=" ", isDocString=False</i>) |
|
2254 |
1728 <p> |
2255 <p> |
1729 Constructor |
2256 Constructor |
1730 </p><dl> |
2257 </p> |
|
2258 <dl> |
|
2259 |
1731 <dt><i>curLine</i></dt> |
2260 <dt><i>curLine</i></dt> |
1732 <dd> |
2261 <dd> |
1733 text to work on (string) |
2262 text to work on (string) |
1734 </dd><dt><i>prevLine</i></dt> |
2263 </dd> |
|
2264 <dt><i>prevLine</i></dt> |
1735 <dd> |
2265 <dd> |
1736 line before the text to work on (string) |
2266 line before the text to work on (string) |
1737 </dd><dt><i>nextLine</i></dt> |
2267 </dd> |
|
2268 <dt><i>nextLine</i></dt> |
1738 <dd> |
2269 <dd> |
1739 line after the text to work on (string) |
2270 line after the text to work on (string) |
1740 </dd><dt><i>maxLength=</i></dt> |
2271 </dd> |
|
2272 <dt><i>maxLength=</i></dt> |
1741 <dd> |
2273 <dd> |
1742 maximum allowed line length (integer) |
2274 maximum allowed line length (integer) |
1743 </dd><dt><i>eol=</i></dt> |
2275 </dd> |
|
2276 <dt><i>eol=</i></dt> |
1744 <dd> |
2277 <dd> |
1745 eond-of-line marker (string) |
2278 eond-of-line marker (string) |
1746 </dd><dt><i>indentWord=</i></dt> |
2279 </dd> |
|
2280 <dt><i>indentWord=</i></dt> |
1747 <dd> |
2281 <dd> |
1748 string used for indentation (string) |
2282 string used for indentation (string) |
1749 </dd><dt><i>isDocString=</i></dt> |
2283 </dd> |
|
2284 <dt><i>isDocString=</i></dt> |
1750 <dd> |
2285 <dd> |
1751 flag indicating that the line belongs to |
2286 flag indicating that the line belongs to |
1752 a documentation string (boolean) |
2287 a documentation string (boolean) |
1753 </dd> |
2288 </dd> |
1754 </dl><a NAME="LineShortener.__breakMultiline" ID="LineShortener.__breakMultiline"></a> |
2289 </dl> |
|
2290 <a NAME="LineShortener.__breakMultiline" ID="LineShortener.__breakMultiline"></a> |
1755 <h4>LineShortener.__breakMultiline</h4> |
2291 <h4>LineShortener.__breakMultiline</h4> |
1756 <b>__breakMultiline</b>(<i></i>) |
2292 <b>__breakMultiline</b>(<i></i>) |
|
2293 |
1757 <p> |
2294 <p> |
1758 Private method to break multi line strings. |
2295 Private method to break multi line strings. |
1759 </p><dl> |
2296 </p> |
|
2297 <dl> |
1760 <dt>Returns:</dt> |
2298 <dt>Returns:</dt> |
1761 <dd> |
2299 <dd> |
1762 tuple of the shortened line and the changed next line |
2300 tuple of the shortened line and the changed next line |
1763 (string, string) |
2301 (string, string) |
1764 </dd> |
2302 </dd> |
1765 </dl><a NAME="LineShortener.__checkSyntax" ID="LineShortener.__checkSyntax"></a> |
2303 </dl> |
|
2304 <a NAME="LineShortener.__checkSyntax" ID="LineShortener.__checkSyntax"></a> |
1766 <h4>LineShortener.__checkSyntax</h4> |
2305 <h4>LineShortener.__checkSyntax</h4> |
1767 <b>__checkSyntax</b>(<i>code</i>) |
2306 <b>__checkSyntax</b>(<i>code</i>) |
|
2307 |
1768 <p> |
2308 <p> |
1769 Private method to check the syntax of the given code fragment. |
2309 Private method to check the syntax of the given code fragment. |
1770 </p><dl> |
2310 </p> |
|
2311 <dl> |
|
2312 |
1771 <dt><i>code</i></dt> |
2313 <dt><i>code</i></dt> |
1772 <dd> |
2314 <dd> |
1773 code fragment to check (string) |
2315 code fragment to check (string) |
1774 </dd> |
2316 </dd> |
1775 </dl><dl> |
2317 </dl> |
|
2318 <dl> |
1776 <dt>Returns:</dt> |
2319 <dt>Returns:</dt> |
1777 <dd> |
2320 <dd> |
1778 flag indicating syntax is ok (boolean) |
2321 flag indicating syntax is ok (boolean) |
1779 </dd> |
2322 </dd> |
1780 </dl><a NAME="LineShortener.__countUnbalancedBrackets" ID="LineShortener.__countUnbalancedBrackets"></a> |
2323 </dl> |
|
2324 <a NAME="LineShortener.__countUnbalancedBrackets" ID="LineShortener.__countUnbalancedBrackets"></a> |
1781 <h4>LineShortener.__countUnbalancedBrackets</h4> |
2325 <h4>LineShortener.__countUnbalancedBrackets</h4> |
1782 <b>__countUnbalancedBrackets</b>(<i>line</i>) |
2326 <b>__countUnbalancedBrackets</b>(<i>line</i>) |
|
2327 |
1783 <p> |
2328 <p> |
1784 Private method to determine the number of unmatched open/close |
2329 Private method to determine the number of unmatched open/close |
1785 brackets. |
2330 brackets. |
1786 </p><dl> |
2331 </p> |
|
2332 <dl> |
|
2333 |
1787 <dt><i>line</i></dt> |
2334 <dt><i>line</i></dt> |
1788 <dd> |
2335 <dd> |
1789 line to work at (string) |
2336 line to work at (string) |
1790 </dd> |
2337 </dd> |
1791 </dl><dl> |
2338 </dl> |
|
2339 <dl> |
1792 <dt>Returns:</dt> |
2340 <dt>Returns:</dt> |
1793 <dd> |
2341 <dd> |
1794 number of unmatched open/close brackets (integer) |
2342 number of unmatched open/close brackets (integer) |
1795 </dd> |
2343 </dd> |
1796 </dl><a NAME="LineShortener.__getIndent" ID="LineShortener.__getIndent"></a> |
2344 </dl> |
|
2345 <a NAME="LineShortener.__getIndent" ID="LineShortener.__getIndent"></a> |
1797 <h4>LineShortener.__getIndent</h4> |
2346 <h4>LineShortener.__getIndent</h4> |
1798 <b>__getIndent</b>(<i>line</i>) |
2347 <b>__getIndent</b>(<i>line</i>) |
|
2348 |
1799 <p> |
2349 <p> |
1800 Private method to get the indentation string. |
2350 Private method to get the indentation string. |
1801 </p><dl> |
2351 </p> |
|
2352 <dl> |
|
2353 |
1802 <dt><i>line</i></dt> |
2354 <dt><i>line</i></dt> |
1803 <dd> |
2355 <dd> |
1804 line to determine the indentation string from (string) |
2356 line to determine the indentation string from (string) |
1805 </dd> |
2357 </dd> |
1806 </dl><dl> |
2358 </dl> |
|
2359 <dl> |
1807 <dt>Returns:</dt> |
2360 <dt>Returns:</dt> |
1808 <dd> |
2361 <dd> |
1809 indentation string (string) |
2362 indentation string (string) |
1810 </dd> |
2363 </dd> |
1811 </dl><a NAME="LineShortener.__isProbablyInsideStringOrComment" ID="LineShortener.__isProbablyInsideStringOrComment"></a> |
2364 </dl> |
|
2365 <a NAME="LineShortener.__isProbablyInsideStringOrComment" ID="LineShortener.__isProbablyInsideStringOrComment"></a> |
1812 <h4>LineShortener.__isProbablyInsideStringOrComment</h4> |
2366 <h4>LineShortener.__isProbablyInsideStringOrComment</h4> |
1813 <b>__isProbablyInsideStringOrComment</b>(<i>line, index</i>) |
2367 <b>__isProbablyInsideStringOrComment</b>(<i>line, index</i>) |
|
2368 |
1814 <p> |
2369 <p> |
1815 Private method to check, if the given string might be inside a string |
2370 Private method to check, if the given string might be inside a string |
1816 or comment. |
2371 or comment. |
1817 </p><dl> |
2372 </p> |
|
2373 <dl> |
|
2374 |
1818 <dt><i>line</i></dt> |
2375 <dt><i>line</i></dt> |
1819 <dd> |
2376 <dd> |
1820 line to check (string) |
2377 line to check (string) |
1821 </dd><dt><i>index</i></dt> |
2378 </dd> |
|
2379 <dt><i>index</i></dt> |
1822 <dd> |
2380 <dd> |
1823 position inside line to check (integer) |
2381 position inside line to check (integer) |
1824 </dd> |
2382 </dd> |
1825 </dl><dl> |
2383 </dl> |
|
2384 <dl> |
1826 <dt>Returns:</dt> |
2385 <dt>Returns:</dt> |
1827 <dd> |
2386 <dd> |
1828 flag indicating the possibility of being inside a string |
2387 flag indicating the possibility of being inside a string |
1829 or comment |
2388 or comment |
1830 </dd> |
2389 </dd> |
1831 </dl><a NAME="LineShortener.__lineShorteningRank" ID="LineShortener.__lineShorteningRank"></a> |
2390 </dl> |
|
2391 <a NAME="LineShortener.__lineShorteningRank" ID="LineShortener.__lineShorteningRank"></a> |
1832 <h4>LineShortener.__lineShorteningRank</h4> |
2392 <h4>LineShortener.__lineShorteningRank</h4> |
1833 <b>__lineShorteningRank</b>(<i>candidate</i>) |
2393 <b>__lineShorteningRank</b>(<i>candidate</i>) |
|
2394 |
1834 <p> |
2395 <p> |
1835 Private method to rank a candidate. |
2396 Private method to rank a candidate. |
1836 </p><dl> |
2397 </p> |
|
2398 <dl> |
|
2399 |
1837 <dt><i>candidate</i></dt> |
2400 <dt><i>candidate</i></dt> |
1838 <dd> |
2401 <dd> |
1839 candidate line to rank (string) |
2402 candidate line to rank (string) |
1840 </dd> |
2403 </dd> |
1841 </dl><dl> |
2404 </dl> |
|
2405 <dl> |
1842 <dt>Returns:</dt> |
2406 <dt>Returns:</dt> |
1843 <dd> |
2407 <dd> |
1844 rank of the candidate (integer) |
2408 rank of the candidate (integer) |
1845 </dd> |
2409 </dd> |
1846 </dl><a NAME="LineShortener.__normalizeMultiline" ID="LineShortener.__normalizeMultiline"></a> |
2410 </dl> |
|
2411 <a NAME="LineShortener.__normalizeMultiline" ID="LineShortener.__normalizeMultiline"></a> |
1847 <h4>LineShortener.__normalizeMultiline</h4> |
2412 <h4>LineShortener.__normalizeMultiline</h4> |
1848 <b>__normalizeMultiline</b>(<i>text</i>) |
2413 <b>__normalizeMultiline</b>(<i>text</i>) |
|
2414 |
1849 <p> |
2415 <p> |
1850 Private method to remove multiline-related code that will cause syntax |
2416 Private method to remove multiline-related code that will cause syntax |
1851 error. |
2417 error. |
1852 </p><dl> |
2418 </p> |
|
2419 <dl> |
|
2420 |
1853 <dt><i>text</i></dt> |
2421 <dt><i>text</i></dt> |
1854 <dd> |
2422 <dd> |
1855 code line to work on (string) |
2423 code line to work on (string) |
1856 </dd> |
2424 </dd> |
1857 </dl><dl> |
2425 </dl> |
|
2426 <dl> |
1858 <dt>Returns:</dt> |
2427 <dt>Returns:</dt> |
1859 <dd> |
2428 <dd> |
1860 normalized code line (string) |
2429 normalized code line (string) |
1861 </dd> |
2430 </dd> |
1862 </dl><a NAME="LineShortener.__shortenComment" ID="LineShortener.__shortenComment"></a> |
2431 </dl> |
|
2432 <a NAME="LineShortener.__shortenComment" ID="LineShortener.__shortenComment"></a> |
1863 <h4>LineShortener.__shortenComment</h4> |
2433 <h4>LineShortener.__shortenComment</h4> |
1864 <b>__shortenComment</b>(<i>isLast</i>) |
2434 <b>__shortenComment</b>(<i>isLast</i>) |
|
2435 |
1865 <p> |
2436 <p> |
1866 Private method to shorten a comment line. |
2437 Private method to shorten a comment line. |
1867 </p><dl> |
2438 </p> |
|
2439 <dl> |
|
2440 |
1868 <dt><i>isLast</i></dt> |
2441 <dt><i>isLast</i></dt> |
1869 <dd> |
2442 <dd> |
1870 flag indicating, that the line is the last comment line |
2443 flag indicating, that the line is the last comment line |
1871 (boolean) |
2444 (boolean) |
1872 </dd> |
2445 </dd> |
1873 </dl><dl> |
2446 </dl> |
|
2447 <dl> |
1874 <dt>Returns:</dt> |
2448 <dt>Returns:</dt> |
1875 <dd> |
2449 <dd> |
1876 shortened comment line (string) |
2450 shortened comment line (string) |
1877 </dd> |
2451 </dd> |
1878 </dl><a NAME="LineShortener.__shortenLine" ID="LineShortener.__shortenLine"></a> |
2452 </dl> |
|
2453 <a NAME="LineShortener.__shortenLine" ID="LineShortener.__shortenLine"></a> |
1879 <h4>LineShortener.__shortenLine</h4> |
2454 <h4>LineShortener.__shortenLine</h4> |
1880 <b>__shortenLine</b>(<i>tokens, source, indent</i>) |
2455 <b>__shortenLine</b>(<i>tokens, source, indent</i>) |
|
2456 |
1881 <p> |
2457 <p> |
1882 Private method to shorten a line of code at an operator. |
2458 Private method to shorten a line of code at an operator. |
1883 </p><dl> |
2459 </p> |
|
2460 <dl> |
|
2461 |
1884 <dt><i>tokens</i></dt> |
2462 <dt><i>tokens</i></dt> |
1885 <dd> |
2463 <dd> |
1886 tokens of the line as generated by tokenize |
2464 tokens of the line as generated by tokenize |
1887 (list of token) |
2465 (list of token) |
1888 </dd><dt><i>source</i></dt> |
2466 </dd> |
|
2467 <dt><i>source</i></dt> |
1889 <dd> |
2468 <dd> |
1890 code string to work at (string) |
2469 code string to work at (string) |
1891 </dd><dt><i>indent</i></dt> |
2470 </dd> |
|
2471 <dt><i>indent</i></dt> |
1892 <dd> |
2472 <dd> |
1893 indentation string of the code line (string) |
2473 indentation string of the code line (string) |
1894 </dd> |
2474 </dd> |
1895 </dl><dl> |
2475 </dl> |
|
2476 <dl> |
1896 <dt>Returns:</dt> |
2477 <dt>Returns:</dt> |
1897 <dd> |
2478 <dd> |
1898 list of candidates (list of string) |
2479 list of candidates (list of string) |
1899 </dd> |
2480 </dd> |
1900 </dl><a NAME="LineShortener.shorten" ID="LineShortener.shorten"></a> |
2481 </dl> |
|
2482 <a NAME="LineShortener.shorten" ID="LineShortener.shorten"></a> |
1901 <h4>LineShortener.shorten</h4> |
2483 <h4>LineShortener.shorten</h4> |
1902 <b>shorten</b>(<i></i>) |
2484 <b>shorten</b>(<i></i>) |
|
2485 |
1903 <p> |
2486 <p> |
1904 Public method to shorten the line wrapped by the class instance. |
2487 Public method to shorten the line wrapped by the class instance. |
1905 </p><dl> |
2488 </p> |
|
2489 <dl> |
1906 <dt>Returns:</dt> |
2490 <dt>Returns:</dt> |
1907 <dd> |
2491 <dd> |
1908 tuple of a flag indicating successful shortening, the |
2492 tuple of a flag indicating successful shortening, the |
1909 shortened line and the changed next line (boolean, string, string) |
2493 shortened line and the changed next line (boolean, string, string) |
1910 </dd> |
2494 </dd> |
1911 </dl> |
2495 </dl> |
1912 <div align="right"><a href="#top">Up</a></div> |
2496 <div align="right"><a href="#top">Up</a></div> |
1913 <hr /><hr /> |
2497 <hr /> |
|
2498 <hr /> |
1914 <a NAME="Reindenter" ID="Reindenter"></a> |
2499 <a NAME="Reindenter" ID="Reindenter"></a> |
1915 <h2>Reindenter</h2> |
2500 <h2>Reindenter</h2> |
|
2501 |
1916 <p> |
2502 <p> |
1917 Class to reindent badly-indented code to uniformly use four-space |
2503 Class to reindent badly-indented code to uniformly use four-space |
1918 indentation. |
2504 indentation. |
1919 </p><p> |
2505 </p> |
|
2506 <p> |
1920 Released to the public domain, by Tim Peters, 03 October 2000. |
2507 Released to the public domain, by Tim Peters, 03 October 2000. |
1921 </p> |
2508 </p> |
1922 <h3>Derived from</h3> |
2509 <h3>Derived from</h3> |
1923 object |
2510 object |
1924 <h3>Class Attributes</h3> |
2511 <h3>Class Attributes</h3> |
|
2512 |
1925 <table> |
2513 <table> |
1926 <tr><td>None</td></tr> |
2514 <tr><td>None</td></tr> |
1927 </table> |
2515 </table> |
1928 <h3>Class Methods</h3> |
2516 <h3>Class Methods</h3> |
|
2517 |
1929 <table> |
2518 <table> |
1930 <tr><td>None</td></tr> |
2519 <tr><td>None</td></tr> |
1931 </table> |
2520 </table> |
1932 <h3>Methods</h3> |
2521 <h3>Methods</h3> |
|
2522 |
1933 <table> |
2523 <table> |
|
2524 |
1934 <tr> |
2525 <tr> |
1935 <td><a href="#Reindenter.__init__">Reindenter</a></td> |
2526 <td><a href="#Reindenter.__init__">Reindenter</a></td> |
1936 <td>Constructor</td> |
2527 <td>Constructor</td> |
1937 </tr><tr> |
2528 </tr> |
|
2529 <tr> |
1938 <td><a href="#Reindenter.__genStats">__genStats</a></td> |
2530 <td><a href="#Reindenter.__genStats">__genStats</a></td> |
1939 <td>Private method to generate the re-indent statistics.</td> |
2531 <td>Private method to generate the re-indent statistics.</td> |
1940 </tr><tr> |
2532 </tr> |
|
2533 <tr> |
1941 <td><a href="#Reindenter.__getlspace">__getlspace</a></td> |
2534 <td><a href="#Reindenter.__getlspace">__getlspace</a></td> |
1942 <td>Private method to count number of leading blanks.</td> |
2535 <td>Private method to count number of leading blanks.</td> |
1943 </tr><tr> |
2536 </tr> |
|
2537 <tr> |
1944 <td><a href="#Reindenter.fixedLine">fixedLine</a></td> |
2538 <td><a href="#Reindenter.fixedLine">fixedLine</a></td> |
1945 <td>Public method to get a fixed line.</td> |
2539 <td>Public method to get a fixed line.</td> |
1946 </tr><tr> |
2540 </tr> |
|
2541 <tr> |
1947 <td><a href="#Reindenter.getline">getline</a></td> |
2542 <td><a href="#Reindenter.getline">getline</a></td> |
1948 <td>Public method to get a line of text for tokenize.</td> |
2543 <td>Public method to get a line of text for tokenize.</td> |
1949 </tr><tr> |
2544 </tr> |
|
2545 <tr> |
1950 <td><a href="#Reindenter.run">run</a></td> |
2546 <td><a href="#Reindenter.run">run</a></td> |
1951 <td>Public method to run the re-indenter.</td> |
2547 <td>Public method to run the re-indenter.</td> |
1952 </tr> |
2548 </tr> |
1953 </table> |
2549 </table> |
1954 <h3>Static Methods</h3> |
2550 <h3>Static Methods</h3> |
|
2551 |
1955 <table> |
2552 <table> |
1956 <tr><td>None</td></tr> |
2553 <tr><td>None</td></tr> |
1957 </table> |
2554 </table> |
|
2555 |
1958 <a NAME="Reindenter.__init__" ID="Reindenter.__init__"></a> |
2556 <a NAME="Reindenter.__init__" ID="Reindenter.__init__"></a> |
1959 <h4>Reindenter (Constructor)</h4> |
2557 <h4>Reindenter (Constructor)</h4> |
1960 <b>Reindenter</b>(<i>sourceLines</i>) |
2558 <b>Reindenter</b>(<i>sourceLines</i>) |
|
2559 |
1961 <p> |
2560 <p> |
1962 Constructor |
2561 Constructor |
1963 </p><dl> |
2562 </p> |
|
2563 <dl> |
|
2564 |
1964 <dt><i>sourceLines</i></dt> |
2565 <dt><i>sourceLines</i></dt> |
1965 <dd> |
2566 <dd> |
1966 list of source lines including eol marker |
2567 list of source lines including eol marker |
1967 (list of string) |
2568 (list of string) |
1968 </dd> |
2569 </dd> |
1969 </dl><a NAME="Reindenter.__genStats" ID="Reindenter.__genStats"></a> |
2570 </dl> |
|
2571 <a NAME="Reindenter.__genStats" ID="Reindenter.__genStats"></a> |
1970 <h4>Reindenter.__genStats</h4> |
2572 <h4>Reindenter.__genStats</h4> |
1971 <b>__genStats</b>(<i>tokens</i>) |
2573 <b>__genStats</b>(<i>tokens</i>) |
|
2574 |
1972 <p> |
2575 <p> |
1973 Private method to generate the re-indent statistics. |
2576 Private method to generate the re-indent statistics. |
1974 </p><dl> |
2577 </p> |
|
2578 <dl> |
|
2579 |
1975 <dt><i>tokens</i></dt> |
2580 <dt><i>tokens</i></dt> |
1976 <dd> |
2581 <dd> |
1977 tokens generator (tokenize._tokenize) |
2582 tokens generator (tokenize._tokenize) |
1978 </dd> |
2583 </dd> |
1979 </dl><dl> |
2584 </dl> |
|
2585 <dl> |
1980 <dt>Returns:</dt> |
2586 <dt>Returns:</dt> |
1981 <dd> |
2587 <dd> |
1982 reference to the generated statistics |
2588 reference to the generated statistics |
1983 </dd> |
2589 </dd> |
1984 </dl><a NAME="Reindenter.__getlspace" ID="Reindenter.__getlspace"></a> |
2590 </dl> |
|
2591 <a NAME="Reindenter.__getlspace" ID="Reindenter.__getlspace"></a> |
1985 <h4>Reindenter.__getlspace</h4> |
2592 <h4>Reindenter.__getlspace</h4> |
1986 <b>__getlspace</b>(<i>line</i>) |
2593 <b>__getlspace</b>(<i>line</i>) |
|
2594 |
1987 <p> |
2595 <p> |
1988 Private method to count number of leading blanks. |
2596 Private method to count number of leading blanks. |
1989 </p><dl> |
2597 </p> |
|
2598 <dl> |
|
2599 |
1990 <dt><i>line</i></dt> |
2600 <dt><i>line</i></dt> |
1991 <dd> |
2601 <dd> |
1992 line to check (string) |
2602 line to check (string) |
1993 </dd> |
2603 </dd> |
1994 </dl><dl> |
2604 </dl> |
|
2605 <dl> |
1995 <dt>Returns:</dt> |
2606 <dt>Returns:</dt> |
1996 <dd> |
2607 <dd> |
1997 number of leading blanks (integer) |
2608 number of leading blanks (integer) |
1998 </dd> |
2609 </dd> |
1999 </dl><a NAME="Reindenter.fixedLine" ID="Reindenter.fixedLine"></a> |
2610 </dl> |
|
2611 <a NAME="Reindenter.fixedLine" ID="Reindenter.fixedLine"></a> |
2000 <h4>Reindenter.fixedLine</h4> |
2612 <h4>Reindenter.fixedLine</h4> |
2001 <b>fixedLine</b>(<i>line</i>) |
2613 <b>fixedLine</b>(<i>line</i>) |
|
2614 |
2002 <p> |
2615 <p> |
2003 Public method to get a fixed line. |
2616 Public method to get a fixed line. |
2004 </p><dl> |
2617 </p> |
|
2618 <dl> |
|
2619 |
2005 <dt><i>line</i></dt> |
2620 <dt><i>line</i></dt> |
2006 <dd> |
2621 <dd> |
2007 number of the line to retrieve (integer) |
2622 number of the line to retrieve (integer) |
2008 </dd> |
2623 </dd> |
2009 </dl><dl> |
2624 </dl> |
|
2625 <dl> |
2010 <dt>Returns:</dt> |
2626 <dt>Returns:</dt> |
2011 <dd> |
2627 <dd> |
2012 fixed line (string) |
2628 fixed line (string) |
2013 </dd> |
2629 </dd> |
2014 </dl><a NAME="Reindenter.getline" ID="Reindenter.getline"></a> |
2630 </dl> |
|
2631 <a NAME="Reindenter.getline" ID="Reindenter.getline"></a> |
2015 <h4>Reindenter.getline</h4> |
2632 <h4>Reindenter.getline</h4> |
2016 <b>getline</b>(<i></i>) |
2633 <b>getline</b>(<i></i>) |
|
2634 |
2017 <p> |
2635 <p> |
2018 Public method to get a line of text for tokenize. |
2636 Public method to get a line of text for tokenize. |
2019 </p><dl> |
2637 </p> |
|
2638 <dl> |
2020 <dt>Returns:</dt> |
2639 <dt>Returns:</dt> |
2021 <dd> |
2640 <dd> |
2022 line of text (string) |
2641 line of text (string) |
2023 </dd> |
2642 </dd> |
2024 </dl><a NAME="Reindenter.run" ID="Reindenter.run"></a> |
2643 </dl> |
|
2644 <a NAME="Reindenter.run" ID="Reindenter.run"></a> |
2025 <h4>Reindenter.run</h4> |
2645 <h4>Reindenter.run</h4> |
2026 <b>run</b>(<i></i>) |
2646 <b>run</b>(<i></i>) |
|
2647 |
2027 <p> |
2648 <p> |
2028 Public method to run the re-indenter. |
2649 Public method to run the re-indenter. |
2029 </p><dl> |
2650 </p> |
|
2651 <dl> |
2030 <dt>Returns:</dt> |
2652 <dt>Returns:</dt> |
2031 <dd> |
2653 <dd> |
2032 flag indicating that a change was done (boolean) |
2654 flag indicating that a change was done (boolean) |
2033 </dd> |
2655 </dd> |
2034 </dl> |
2656 </dl> |