--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html Sun Mar 30 22:00:14 2014 +0200 @@ -30,22 +30,31 @@ <h3>Classes</h3> <table> <tr> -<td><a href="#CodeStyleCheckerPy2">CodeStyleCheckerPy2</a></td> -<td>Class implementing the code style checker interface for Python 2.</td> +<td><a href="#CodeStyleCheckerReport">CodeStyleCheckerReport</a></td> +<td>Class implementing a special report to be used with our dialog.</td> </tr> </table> <h3>Functions</h3> <table> -<tr><td>None</td></tr> +<tr> +<td><a href="#codeStyleCheck">codeStyleCheck</a></td> +<td>Do the code style check and/ or fix found errors.</td> +</tr><tr> +<td><a href="#extractLineFlags">extractLineFlags</a></td> +<td>Function to extract flags starting and ending with '__' from a line comment.</td> +</tr><tr> +<td><a href="#initService">initService</a></td> +<td>Initialize the service and return the entry point.</td> +</tr> </table> <hr /><hr /> -<a NAME="CodeStyleCheckerPy2" ID="CodeStyleCheckerPy2"></a> -<h2>CodeStyleCheckerPy2</h2> +<a NAME="CodeStyleCheckerReport" ID="CodeStyleCheckerReport"></a> +<h2>CodeStyleCheckerReport</h2> <p> - Class implementing the code style checker interface for Python 2. + Class implementing a special report to be used with our dialog. </p> <h3>Derived from</h3> -object +pep8.BaseReport <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> @@ -57,54 +66,121 @@ <h3>Methods</h3> <table> <tr> -<td><a href="#CodeStyleCheckerPy2.__init__">CodeStyleCheckerPy2</a></td> +<td><a href="#CodeStyleCheckerReport.__init__">CodeStyleCheckerReport</a></td> <td>Constructor</td> +</tr><tr> +<td><a href="#CodeStyleCheckerReport.error_args">error_args</a></td> +<td>Public method to collect the error messages.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> -<a NAME="CodeStyleCheckerPy2.__init__" ID="CodeStyleCheckerPy2.__init__"></a> -<h4>CodeStyleCheckerPy2 (Constructor)</h4> -<b>CodeStyleCheckerPy2</b>(<i>filename, lines, repeat=False, select="", ignore="", max_line_length=79, hang_closing=False, docType="pep257"</i>) +<a NAME="CodeStyleCheckerReport.__init__" ID="CodeStyleCheckerReport.__init__"></a> +<h4>CodeStyleCheckerReport (Constructor)</h4> +<b>CodeStyleCheckerReport</b>(<i>options</i>) <p> Constructor </p><dl> +<dt><i>options</i></dt> +<dd> +options for the report (optparse.Values) +</dd> +</dl><a NAME="CodeStyleCheckerReport.error_args" ID="CodeStyleCheckerReport.error_args"></a> +<h4>CodeStyleCheckerReport.error_args</h4> +<b>error_args</b>(<i>line_number, offset, code, check, *args</i>) +<p> + Public method to collect the error messages. +</p><dl> +<dt><i>line_number</i></dt> +<dd> +line number of the issue (integer) +</dd><dt><i>offset</i></dt> +<dd> +position within line of the issue (integer) +</dd><dt><i>code</i></dt> +<dd> +message code (string) +</dd><dt><i>check</i></dt> +<dd> +reference to the checker function (function) +</dd><dt><i>args</i></dt> +<dd> +arguments for the message (list) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +error code (string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="codeStyleCheck" ID="codeStyleCheck"></a> +<h2>codeStyleCheck</h2> +<b>codeStyleCheck</b>(<i>filename, source, args</i>) +<p> + Do the code style check and/ or fix found errors. +</p><dl> <dt><i>filename</i></dt> <dd> -name of the file to check (string) -</dd><dt><i>lines</i></dt> -<dd> -source of the file (list of strings) (ignored) -</dd><dt><i>repeat=</i></dt> +source filename (string) +</dd><dt><i>source</i></dt> <dd> -flag indicating to repeat message categories (boolean) -</dd><dt><i>select=</i></dt> -<dd> -list of message IDs to check for - (comma separated string) -</dd><dt><i>ignore=</i></dt> +string containing the code to check (string) +</dd><dt><i>args</i></dt> <dd> -list of message IDs to ignore - (comma separated string) -</dd><dt><i>max_line_length=</i></dt> -<dd> -maximum allowed line length (integer) -</dd><dt><i>hang_closing=</i></dt> -<dd> -flag indicating to allow hanging closing - brackets (boolean) -</dd><dt><i>docType=</i></dt> -<dd> -type of the documentation strings - (string, one of 'eric' or 'pep257') +arguments used by the codeStyleCheck function (list of + excludeMessages (str), includeMessages (str), repeatMessages + (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), + maxLineLength (int), hangClosing (bool), docType (str), errors + (list of str), eol (str), encoding (str)) </dd> </dl><dl> -<dt>Raises <b>AssertionError</b>:</dt> +<dt>Returns:</dt> +<dd> +tuple of stats (dict) and results (tuple for each found violation + of style (tuple of lineno (int), position (int), text (str), fixed + (bool), autofixing (bool), fixedMsg (str))) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="extractLineFlags" ID="extractLineFlags"></a> +<h2>extractLineFlags</h2> +<b>extractLineFlags</b>(<i>line, startComment="</i>) +<p> + Function to extract flags starting and ending with '__' from a line + comment. +</p><dl> +<dt><i>line</i></dt> +<dd> +line to extract flags from (string) +</dd><dt><i>startComment=</i></dt> <dd> -raised if the docType argument is not - "eric" or "pep257" +string identifying the start of the comment (string) +</dd><dt><i>endComment=</i></dt> +<dd> +string identifying the end of a comment (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +list containing the extracted flags (list of strings) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="initService" ID="initService"></a> +<h2>initService</h2> +<b>initService</b>(<i></i>) +<p> + Initialize the service and return the entry point. +</p><dl> +<dt>Returns:</dt> +<dd> +the entry point for the background client (function) </dd> </dl> <div align="right"><a href="#top">Up</a></div>