Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html

changeset 6264
04a671fa4adb
parent 5147
d39dd5cee0c8
child 6265
56bd09c4c297
--- a/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html	Sat Apr 21 17:11:05 2018 +0200
+++ b/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html	Sat Apr 21 17:43:41 2018 +0200
@@ -75,6 +75,9 @@
 <td><a href="#CodeStyleFixer.__findLogical">__findLogical</a></td>
 <td>Private method to extract the index of all the starts and ends of lines.</td>
 </tr><tr>
+<td><a href="#CodeStyleFixer.__fixBlankLinesBefore">__fixBlankLinesBefore</a></td>
+<td>Private method to fix the need for blank lines before class, function and method definitions.</td>
+</tr><tr>
 <td><a href="#CodeStyleFixer.__fixD111">__fixD111</a></td>
 <td>Private method to fix docstring enclosed in wrong quotes.</td>
 </tr><tr>
@@ -150,15 +153,6 @@
 <td><a href="#CodeStyleFixer.__fixE261">__fixE261</a></td>
 <td>Private method to fix whitespace before or after inline comment.</td>
 </tr><tr>
-<td><a href="#CodeStyleFixer.__fixE301">__fixE301</a></td>
-<td>Private method to fix the need for one blank line.</td>
-</tr><tr>
-<td><a href="#CodeStyleFixer.__fixE302">__fixE302</a></td>
-<td>Private method to fix the need for two blank lines.</td>
-</tr><tr>
-<td><a href="#CodeStyleFixer.__fixE303">__fixE303</a></td>
-<td>Private method to fix superfluous blank lines.</td>
-</tr><tr>
 <td><a href="#CodeStyleFixer.__fixE304">__fixE304</a></td>
 <td>Private method to fix superfluous blank lines after a function decorator.</td>
 </tr><tr>
@@ -238,38 +232,42 @@
 </table>
 <a NAME="CodeStyleFixer.__init__" ID="CodeStyleFixer.__init__"></a>
 <h4>CodeStyleFixer (Constructor)</h4>
-<b>CodeStyleFixer</b>(<i>filename, sourceLines, fixCodes, noFixCodes, maxLineLength, inPlace, eol, backup=False</i>)
+<b>CodeStyleFixer</b>(<i>filename, sourceLines, fixCodes, noFixCodes, maxLineLength, blankLines, inPlace, eol, backup=False</i>)
 <p>
         Constructor
 </p><dl>
-<dt><i>filename</i></dt>
+<dt><i>filename</i> (str)</dt>
 <dd>
-name of the file to be fixed (string)
-</dd><dt><i>sourceLines</i></dt>
+name of the file to be fixed
+</dd><dt><i>sourceLines</i> (list of str)</dt>
 <dd>
 list of source lines including eol marker
-            (list of string)
-</dd><dt><i>fixCodes</i></dt>
+</dd><dt><i>fixCodes</i> (str)</dt>
 <dd>
 list of codes to be fixed as a comma separated
-            string (string)
-</dd><dt><i>noFixCodes</i></dt>
+            string
+</dd><dt><i>noFixCodes</i> (str)</dt>
 <dd>
 list of codes not to be fixed as a comma
-            separated string (string)
-</dd><dt><i>maxLineLength</i></dt>
+            separated string
+</dd><dt><i>maxLineLength</i> (int)</dt>
 <dd>
-maximum allowed line length (integer)
-</dd><dt><i>inPlace</i></dt>
+maximum allowed line length
+</dd><dt><i>blanklines</i> (tuple of (int, int))</dt>
 <dd>
-flag indicating to modify the file in place (boolean)
-</dd><dt><i>eol</i></dt>
+tuple containg the number of blank lines before
+            a top level class or function and before a method or nested class
+            or function
+</dd><dt><i>inPlace</i> (bool)</dt>
 <dd>
-end of line character(s) (string)
-</dd><dt><i>backup</i></dt>
+flag indicating to modify the file in place
+</dd><dt><i>eol</i> (str)</dt>
+<dd>
+end of line character(s)
+</dd><dt><i>backup</i> (bool)</dt>
 <dd>
 flag indicating to create a backup before fixing
-            anything (boolean)
+            anything
 </dd>
 </dl><a NAME="CodeStyleFixer.__codeMatch" ID="CodeStyleFixer.__codeMatch"></a>
 <h4>CodeStyleFixer.__codeMatch</h4>
@@ -298,6 +296,36 @@
 tuple containing two lists of integer with start and end tuples
             of lines
 </dd>
+</dl><a NAME="CodeStyleFixer.__fixBlankLinesBefore" ID="CodeStyleFixer.__fixBlankLinesBefore"></a>
+<h4>CodeStyleFixer.__fixBlankLinesBefore</h4>
+<b>__fixBlankLinesBefore</b>(<i>code, line, pos, apply=False</i>)
+<p>
+        Private method to fix the need for blank lines before class, function
+        and method definitions.
+</p><p>
+        Codes: E301, E302, E303, E305, E306, E307, E308
+</p><dl>
+<dt><i>code</i></dt>
+<dd>
+code of the issue (string)
+</dd><dt><i>line</i></dt>
+<dd>
+line number of the issue (integer)
+</dd><dt><i>pos</i></dt>
+<dd>
+position inside line (integer)
+</dd><dt><i>apply=</i></dt>
+<dd>
+flag indicating, that the fix should be applied
+            (boolean)
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+value indicating an applied/deferred fix (-1, 0, 1),
+            a message for the fix (string) and an ID for a deferred
+            fix (integer)
+</dd>
 </dl><a NAME="CodeStyleFixer.__fixD111" ID="CodeStyleFixer.__fixD111"></a>
 <h4>CodeStyleFixer.__fixD111</h4>
 <b>__fixD111</b>(<i>code, line, pos</i>)
@@ -998,93 +1026,6 @@
             a message for the fix (string) and an ID for a deferred
             fix (integer)
 </dd>
-</dl><a NAME="CodeStyleFixer.__fixE301" ID="CodeStyleFixer.__fixE301"></a>
-<h4>CodeStyleFixer.__fixE301</h4>
-<b>__fixE301</b>(<i>code, line, pos, apply=False</i>)
-<p>
-        Private method to fix the need for one blank line.
-</p><p>
-        Codes: E301
-</p><dl>
-<dt><i>code</i></dt>
-<dd>
-code of the issue (string)
-</dd><dt><i>line</i></dt>
-<dd>
-line number of the issue (integer)
-</dd><dt><i>pos</i></dt>
-<dd>
-position inside line (integer)
-</dd><dt><i>apply=</i></dt>
-<dd>
-flag indicating, that the fix should be applied
-            (boolean)
-</dd>
-</dl><dl>
-<dt>Returns:</dt>
-<dd>
-value indicating an applied/deferred fix (-1, 0, 1),
-            a message for the fix (string) and an ID for a deferred
-            fix (integer)
-</dd>
-</dl><a NAME="CodeStyleFixer.__fixE302" ID="CodeStyleFixer.__fixE302"></a>
-<h4>CodeStyleFixer.__fixE302</h4>
-<b>__fixE302</b>(<i>code, line, pos, apply=False</i>)
-<p>
-        Private method to fix the need for two blank lines.
-</p><p>
-        Codes: E302
-</p><dl>
-<dt><i>code</i></dt>
-<dd>
-code of the issue (string)
-</dd><dt><i>line</i></dt>
-<dd>
-line number of the issue (integer)
-</dd><dt><i>pos</i></dt>
-<dd>
-position inside line (integer)
-</dd><dt><i>apply=</i></dt>
-<dd>
-flag indicating, that the fix should be applied
-            (boolean)
-</dd>
-</dl><dl>
-<dt>Returns:</dt>
-<dd>
-value indicating an applied/deferred fix (-1, 0, 1),
-            a message for the fix (string) and an ID for a deferred
-            fix (integer)
-</dd>
-</dl><a NAME="CodeStyleFixer.__fixE303" ID="CodeStyleFixer.__fixE303"></a>
-<h4>CodeStyleFixer.__fixE303</h4>
-<b>__fixE303</b>(<i>code, line, pos, apply=False</i>)
-<p>
-        Private method to fix superfluous blank lines.
-</p><p>
-        Codes: E303
-</p><dl>
-<dt><i>code</i></dt>
-<dd>
-code of the issue (string)
-</dd><dt><i>line</i></dt>
-<dd>
-line number of the issue (integer)
-</dd><dt><i>pos</i></dt>
-<dd>
-position inside line (integer)
-</dd><dt><i>apply=</i></dt>
-<dd>
-flag indicating, that the fix should be applied
-            (boolean)
-</dd>
-</dl><dl>
-<dt>Returns:</dt>
-<dd>
-value indicating an applied/deferred fix (-1, 0, 1),
-            a message for the fix (string) and an ID for a deferred
-            fix (integer)
-</dd>
 </dl><a NAME="CodeStyleFixer.__fixE304" ID="CodeStyleFixer.__fixE304"></a>
 <h4>CodeStyleFixer.__fixE304</h4>
 <b>__fixE304</b>(<i>code, line, pos, apply=False</i>)

eric ide

mercurial