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

changeset 3673
e26d7d0c1088
child 4218
f542ad1f76c5
equal deleted inserted replaced
3670:f0cb7579c0b4 3673:e26d7d0c1088
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker</h1>
23 <p>
24 Module implementing the code style checker.
25 </p>
26 <h3>Global Attributes</h3>
27 <table>
28 <tr><td>None</td></tr>
29 </table>
30 <h3>Classes</h3>
31 <table>
32 <tr>
33 <td><a href="#CodeStyleCheckerReport">CodeStyleCheckerReport</a></td>
34 <td>Class implementing a special report to be used with our dialog.</td>
35 </tr>
36 </table>
37 <h3>Functions</h3>
38 <table>
39 <tr>
40 <td><a href="#codeStyleCheck">codeStyleCheck</a></td>
41 <td>Do the code style check and/ or fix found errors.</td>
42 </tr><tr>
43 <td><a href="#extractLineFlags">extractLineFlags</a></td>
44 <td>Function to extract flags starting and ending with '__' from a line comment.</td>
45 </tr><tr>
46 <td><a href="#initService">initService</a></td>
47 <td>Initialize the service and return the entry point.</td>
48 </tr>
49 </table>
50 <hr /><hr />
51 <a NAME="CodeStyleCheckerReport" ID="CodeStyleCheckerReport"></a>
52 <h2>CodeStyleCheckerReport</h2>
53 <p>
54 Class implementing a special report to be used with our dialog.
55 </p>
56 <h3>Derived from</h3>
57 pep8.BaseReport
58 <h3>Class Attributes</h3>
59 <table>
60 <tr><td>None</td></tr>
61 </table>
62 <h3>Class Methods</h3>
63 <table>
64 <tr><td>None</td></tr>
65 </table>
66 <h3>Methods</h3>
67 <table>
68 <tr>
69 <td><a href="#CodeStyleCheckerReport.__init__">CodeStyleCheckerReport</a></td>
70 <td>Constructor</td>
71 </tr><tr>
72 <td><a href="#CodeStyleCheckerReport.error_args">error_args</a></td>
73 <td>Public method to collect the error messages.</td>
74 </tr>
75 </table>
76 <h3>Static Methods</h3>
77 <table>
78 <tr><td>None</td></tr>
79 </table>
80 <a NAME="CodeStyleCheckerReport.__init__" ID="CodeStyleCheckerReport.__init__"></a>
81 <h4>CodeStyleCheckerReport (Constructor)</h4>
82 <b>CodeStyleCheckerReport</b>(<i>options</i>)
83 <p>
84 Constructor
85 </p><dl>
86 <dt><i>options</i></dt>
87 <dd>
88 options for the report (optparse.Values)
89 </dd>
90 </dl><a NAME="CodeStyleCheckerReport.error_args" ID="CodeStyleCheckerReport.error_args"></a>
91 <h4>CodeStyleCheckerReport.error_args</h4>
92 <b>error_args</b>(<i>line_number, offset, code, check, *args</i>)
93 <p>
94 Public method to collect the error messages.
95 </p><dl>
96 <dt><i>line_number</i></dt>
97 <dd>
98 line number of the issue (integer)
99 </dd><dt><i>offset</i></dt>
100 <dd>
101 position within line of the issue (integer)
102 </dd><dt><i>code</i></dt>
103 <dd>
104 message code (string)
105 </dd><dt><i>check</i></dt>
106 <dd>
107 reference to the checker function (function)
108 </dd><dt><i>args</i></dt>
109 <dd>
110 arguments for the message (list)
111 </dd>
112 </dl><dl>
113 <dt>Returns:</dt>
114 <dd>
115 error code (string)
116 </dd>
117 </dl>
118 <div align="right"><a href="#top">Up</a></div>
119 <hr /><hr />
120 <a NAME="codeStyleCheck" ID="codeStyleCheck"></a>
121 <h2>codeStyleCheck</h2>
122 <b>codeStyleCheck</b>(<i>filename, source, args</i>)
123 <p>
124 Do the code style check and/ or fix found errors.
125 </p><dl>
126 <dt><i>filename</i></dt>
127 <dd>
128 source filename (string)
129 </dd><dt><i>source</i></dt>
130 <dd>
131 string containing the code to check (string)
132 </dd><dt><i>args</i></dt>
133 <dd>
134 arguments used by the codeStyleCheck function (list of
135 excludeMessages (str), includeMessages (str), repeatMessages
136 (bool), fixCodes (str), noFixCodes (str), fixIssues (bool),
137 maxLineLength (int), hangClosing (bool), docType (str), errors
138 (list of str), eol (str), encoding (str), backup (bool))
139 </dd>
140 </dl><dl>
141 <dt>Returns:</dt>
142 <dd>
143 tuple of stats (dict) and results (tuple for each found violation
144 of style (tuple of lineno (int), position (int), text (str), ignored
145 (bool), fixed (bool), autofixing (bool), fixedMsg (str)))
146 </dd>
147 </dl>
148 <div align="right"><a href="#top">Up</a></div>
149 <hr /><hr />
150 <a NAME="extractLineFlags" ID="extractLineFlags"></a>
151 <h2>extractLineFlags</h2>
152 <b>extractLineFlags</b>(<i>line, startComment="</i>)
153 <p>
154 Function to extract flags starting and ending with '__' from a line
155 comment.
156 </p><dl>
157 <dt><i>line</i></dt>
158 <dd>
159 line to extract flags from (string)
160 </dd><dt><i>startComment=</i></dt>
161 <dd>
162 string identifying the start of the comment (string)
163 </dd><dt><i>endComment=</i></dt>
164 <dd>
165 string identifying the end of a comment (string)
166 </dd>
167 </dl><dl>
168 <dt>Returns:</dt>
169 <dd>
170 list containing the extracted flags (list of strings)
171 </dd>
172 </dl>
173 <div align="right"><a href="#top">Up</a></div>
174 <hr /><hr />
175 <a NAME="initService" ID="initService"></a>
176 <h2>initService</h2>
177 <b>initService</b>(<i></i>)
178 <p>
179 Initialize the service and return the entry point.
180 </p><dl>
181 <dt>Returns:</dt>
182 <dd>
183 the entry point for the background client (function)
184 </dd>
185 </dl>
186 <div align="right"><a href="#top">Up</a></div>
187 <hr />
188 </body></html>

eric ide

mercurial