src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Naming.NamingStyleChecker.html

branch
eric7
changeset 10479
856476537696
parent 10437
2f70ca07f0af
child 10684
58c7f23ae1cb
equal deleted inserted replaced
10478:de9106c55c3d 10479:856476537696
5 <link rel="stylesheet" href="styles.css"> 5 <link rel="stylesheet" href="styles.css">
6 </head> 6 </head>
7 <body> 7 <body>
8 <a NAME="top" ID="top"></a> 8 <a NAME="top" ID="top"></a>
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Naming.NamingStyleChecker</h1> 9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Naming.NamingStyleChecker</h1>
10
11 <p> 10 <p>
12 Module implementing a checker for naming conventions. 11 Module implementing a checker for naming conventions.
13 </p> 12 </p>
13
14 <h3>Global Attributes</h3> 14 <h3>Global Attributes</h3>
15
16 <table> 15 <table>
17 <tr><td>None</td></tr> 16 <tr><td>None</td></tr>
18 </table> 17 </table>
18
19 <h3>Classes</h3> 19 <h3>Classes</h3>
20
21 <table> 20 <table>
22
23 <tr> 21 <tr>
24 <td><a href="#NamingStyleChecker">NamingStyleChecker</a></td> 22 <td><a href="#NamingStyleChecker">NamingStyleChecker</a></td>
25 <td>Class implementing a checker for naming conventions.</td> 23 <td>Class implementing a checker for naming conventions.</td>
26 </tr> 24 </tr>
27 </table> 25 </table>
26
28 <h3>Functions</h3> 27 <h3>Functions</h3>
29
30 <table> 28 <table>
31 <tr><td>None</td></tr> 29 <tr><td>None</td></tr>
32 </table> 30 </table>
31
33 <hr /> 32 <hr />
34 <hr /> 33 <hr />
35 <a NAME="NamingStyleChecker" ID="NamingStyleChecker"></a> 34 <a NAME="NamingStyleChecker" ID="NamingStyleChecker"></a>
36 <h2>NamingStyleChecker</h2> 35 <h2>NamingStyleChecker</h2>
37
38 <p> 36 <p>
39 Class implementing a checker for naming conventions. 37 Class implementing a checker for naming conventions.
40 </p> 38 </p>
39
41 <h3>Derived from</h3> 40 <h3>Derived from</h3>
42 None 41 None
43 <h3>Class Attributes</h3> 42 <h3>Class Attributes</h3>
44
45 <table> 43 <table>
46 <tr><td>Codes</td></tr> 44 <tr><td>Codes</td></tr>
47 </table> 45 </table>
46
48 <h3>Class Methods</h3> 47 <h3>Class Methods</h3>
49
50 <table> 48 <table>
51 <tr><td>None</td></tr> 49 <tr><td>None</td></tr>
52 </table> 50 </table>
51
53 <h3>Methods</h3> 52 <h3>Methods</h3>
54
55 <table> 53 <table>
56
57 <tr> 54 <tr>
58 <td><a href="#NamingStyleChecker.__init__">NamingStyleChecker</a></td> 55 <td><a href="#NamingStyleChecker.__init__">NamingStyleChecker</a></td>
59 <td>Constructor (according to 'extended' pycodestyle.py API)</td> 56 <td>Constructor (according to 'extended' pycodestyle.py API)</td>
60 </tr> 57 </tr>
61 <tr> 58 <tr>
153 <tr> 150 <tr>
154 <td><a href="#NamingStyleChecker.run">run</a></td> 151 <td><a href="#NamingStyleChecker.run">run</a></td>
155 <td>Public method run by the pycodestyle.py checker.</td> 152 <td>Public method run by the pycodestyle.py checker.</td>
156 </tr> 153 </tr>
157 </table> 154 </table>
155
158 <h3>Static Methods</h3> 156 <h3>Static Methods</h3>
159
160 <table> 157 <table>
161 <tr><td>None</td></tr> 158 <tr><td>None</td></tr>
162 </table> 159 </table>
163 160
161
164 <a NAME="NamingStyleChecker.__init__" ID="NamingStyleChecker.__init__"></a> 162 <a NAME="NamingStyleChecker.__init__" ID="NamingStyleChecker.__init__"></a>
165 <h4>NamingStyleChecker (Constructor)</h4> 163 <h4>NamingStyleChecker (Constructor)</h4>
166 <b>NamingStyleChecker</b>(<i>tree, filename, options</i>) 164 <b>NamingStyleChecker</b>(<i>tree, filename, options</i>)
167
168 <p> 165 <p>
169 Constructor (according to 'extended' pycodestyle.py API) 166 Constructor (according to 'extended' pycodestyle.py API)
170 </p> 167 </p>
168
171 <dl> 169 <dl>
172 170
173 <dt><i>tree</i> (ast.AST)</dt> 171 <dt><i>tree</i> (ast.AST)</dt>
174 <dd> 172 <dd>
175 AST tree of the source file 173 AST tree of the source file
184 </dd> 182 </dd>
185 </dl> 183 </dl>
186 <a NAME="NamingStyleChecker.__checkClassName" ID="NamingStyleChecker.__checkClassName"></a> 184 <a NAME="NamingStyleChecker.__checkClassName" ID="NamingStyleChecker.__checkClassName"></a>
187 <h4>NamingStyleChecker.__checkClassName</h4> 185 <h4>NamingStyleChecker.__checkClassName</h4>
188 <b>__checkClassName</b>(<i>node, parents</i>) 186 <b>__checkClassName</b>(<i>node, parents</i>)
189
190 <p> 187 <p>
191 Private class to check the given node for class name 188 Private class to check the given node for class name
192 conventions (N801, N818). 189 conventions (N801, N818).
193 </p> 190 </p>
194 <p> 191 <p>
195 Almost without exception, class names use the CapWords convention. 192 Almost without exception, class names use the CapWords convention.
196 Classes for internal use have a leading underscore in addition. 193 Classes for internal use have a leading underscore in addition.
197 </p> 194 </p>
195
198 <dl> 196 <dl>
199 197
200 <dt><i>node</i> (ast.ClassDef)</dt> 198 <dt><i>node</i> (ast.ClassDef)</dt>
201 <dd> 199 <dd>
202 AST note to check 200 AST note to check
219 </dd> 217 </dd>
220 </dl> 218 </dl>
221 <a NAME="NamingStyleChecker.__checkFunctionArgumentNames" ID="NamingStyleChecker.__checkFunctionArgumentNames"></a> 219 <a NAME="NamingStyleChecker.__checkFunctionArgumentNames" ID="NamingStyleChecker.__checkFunctionArgumentNames"></a>
222 <h4>NamingStyleChecker.__checkFunctionArgumentNames</h4> 220 <h4>NamingStyleChecker.__checkFunctionArgumentNames</h4>
223 <b>__checkFunctionArgumentNames</b>(<i>node, parents</i>) 221 <b>__checkFunctionArgumentNames</b>(<i>node, parents</i>)
224
225 <p> 222 <p>
226 Private class to check the argument names of functions 223 Private class to check the argument names of functions
227 (N803, N804, N805, N806). 224 (N803, N804, N805, N806).
228 </p> 225 </p>
229 <p> 226 <p>
230 The argument names of a function should be lowercase, with words 227 The argument names of a function should be lowercase, with words
231 separated by underscores. A class method should have 'cls' as the 228 separated by underscores. A class method should have 'cls' as the
232 first argument. A method should have 'self' as the first argument. 229 first argument. A method should have 'self' as the first argument.
233 </p> 230 </p>
231
234 <dl> 232 <dl>
235 233
236 <dt><i>node</i> (ast.FunctionDef or ast.AsynFunctionDef)</dt> 234 <dt><i>node</i> (ast.FunctionDef or ast.AsynFunctionDef)</dt>
237 <dd> 235 <dd>
238 AST note to check 236 AST note to check
255 </dd> 253 </dd>
256 </dl> 254 </dl>
257 <a NAME="NamingStyleChecker.__checkFunctionName" ID="NamingStyleChecker.__checkFunctionName"></a> 255 <a NAME="NamingStyleChecker.__checkFunctionName" ID="NamingStyleChecker.__checkFunctionName"></a>
258 <h4>NamingStyleChecker.__checkFunctionName</h4> 256 <h4>NamingStyleChecker.__checkFunctionName</h4>
259 <b>__checkFunctionName</b>(<i>node, parents</i>) 257 <b>__checkFunctionName</b>(<i>node, parents</i>)
260
261 <p> 258 <p>
262 Private class to check the given node for function name 259 Private class to check the given node for function name
263 conventions (N802, N809). 260 conventions (N802, N809).
264 </p> 261 </p>
265 <p> 262 <p>
267 as necessary to improve readability. Functions <b>not</b> being 264 as necessary to improve readability. Functions <b>not</b> being
268 methods '__' in front and back are not allowed. Mixed case is allowed 265 methods '__' in front and back are not allowed. Mixed case is allowed
269 only in contexts where that's already the prevailing style 266 only in contexts where that's already the prevailing style
270 (e.g. threading.py), to retain backwards compatibility. 267 (e.g. threading.py), to retain backwards compatibility.
271 </p> 268 </p>
269
272 <dl> 270 <dl>
273 271
274 <dt><i>node</i> (ast.FunctionDef or ast.AsynFunctionDef)</dt> 272 <dt><i>node</i> (ast.FunctionDef or ast.AsynFunctionDef)</dt>
275 <dd> 273 <dd>
276 AST note to check 274 AST note to check
293 </dd> 291 </dd>
294 </dl> 292 </dl>
295 <a NAME="NamingStyleChecker.__checkImportAs" ID="NamingStyleChecker.__checkImportAs"></a> 293 <a NAME="NamingStyleChecker.__checkImportAs" ID="NamingStyleChecker.__checkImportAs"></a>
296 <h4>NamingStyleChecker.__checkImportAs</h4> 294 <h4>NamingStyleChecker.__checkImportAs</h4>
297 <b>__checkImportAs</b>(<i>node, parents</i>) 295 <b>__checkImportAs</b>(<i>node, parents</i>)
298
299 <p> 296 <p>
300 Private method to check that imports don't change the 297 Private method to check that imports don't change the
301 naming convention (N811, N812, N813, N814, N815). 298 naming convention (N811, N812, N813, N814, N815).
302 </p> 299 </p>
300
303 <dl> 301 <dl>
304 302
305 <dt><i>node</i> (ast.Import)</dt> 303 <dt><i>node</i> (ast.Import)</dt>
306 <dd> 304 <dd>
307 AST node to check 305 AST node to check
324 </dd> 322 </dd>
325 </dl> 323 </dl>
326 <a NAME="NamingStyleChecker.__checkModule" ID="NamingStyleChecker.__checkModule"></a> 324 <a NAME="NamingStyleChecker.__checkModule" ID="NamingStyleChecker.__checkModule"></a>
327 <h4>NamingStyleChecker.__checkModule</h4> 325 <h4>NamingStyleChecker.__checkModule</h4>
328 <b>__checkModule</b>(<i>node, parents</i>) 326 <b>__checkModule</b>(<i>node, parents</i>)
329
330 <p> 327 <p>
331 Private method to check module naming conventions (N807, N808). 328 Private method to check module naming conventions (N807, N808).
332 </p> 329 </p>
333 <p> 330 <p>
334 Module and package names should be lowercase. 331 Module and package names should be lowercase.
335 </p> 332 </p>
333
336 <dl> 334 <dl>
337 335
338 <dt><i>node</i> (ast.AST)</dt> 336 <dt><i>node</i> (ast.AST)</dt>
339 <dd> 337 <dd>
340 AST node to check 338 AST node to check
357 </dd> 355 </dd>
358 </dl> 356 </dl>
359 <a NAME="NamingStyleChecker.__checkNameToBeAvoided" ID="NamingStyleChecker.__checkNameToBeAvoided"></a> 357 <a NAME="NamingStyleChecker.__checkNameToBeAvoided" ID="NamingStyleChecker.__checkNameToBeAvoided"></a>
360 <h4>NamingStyleChecker.__checkNameToBeAvoided</h4> 358 <h4>NamingStyleChecker.__checkNameToBeAvoided</h4>
361 <b>__checkNameToBeAvoided</b>(<i>node, parents</i>) 359 <b>__checkNameToBeAvoided</b>(<i>node, parents</i>)
362
363 <p> 360 <p>
364 Private class to check the given node for a name to be avoided (N831). 361 Private class to check the given node for a name to be avoided (N831).
365 </p> 362 </p>
363
366 <dl> 364 <dl>
367 365
368 <dt><i>node</i> (ast.Ast)</dt> 366 <dt><i>node</i> (ast.Ast)</dt>
369 <dd> 367 <dd>
370 AST note to check 368 AST note to check
387 </dd> 385 </dd>
388 </dl> 386 </dl>
389 <a NAME="NamingStyleChecker.__checkVariableNames" ID="NamingStyleChecker.__checkVariableNames"></a> 387 <a NAME="NamingStyleChecker.__checkVariableNames" ID="NamingStyleChecker.__checkVariableNames"></a>
390 <h4>NamingStyleChecker.__checkVariableNames</h4> 388 <h4>NamingStyleChecker.__checkVariableNames</h4>
391 <b>__checkVariableNames</b>(<i>node, parents</i>) 389 <b>__checkVariableNames</b>(<i>node, parents</i>)
392
393 <p> 390 <p>
394 Private method to check variable names in function, class and global scope 391 Private method to check variable names in function, class and global scope
395 (N821, N822, N823). 392 (N821, N822, N823).
396 </p> 393 </p>
397 <p> 394 <p>
398 Local variables in functions should be lowercase. 395 Local variables in functions should be lowercase.
399 </p> 396 </p>
397
400 <dl> 398 <dl>
401 399
402 <dt><i>node</i> (ast.AST)</dt> 400 <dt><i>node</i> (ast.AST)</dt>
403 <dd> 401 <dd>
404 AST note to check 402 AST note to check
421 </dd> 419 </dd>
422 </dl> 420 </dl>
423 <a NAME="NamingStyleChecker.__classVariableCheck" ID="NamingStyleChecker.__classVariableCheck"></a> 421 <a NAME="NamingStyleChecker.__classVariableCheck" ID="NamingStyleChecker.__classVariableCheck"></a>
424 <h4>NamingStyleChecker.__classVariableCheck</h4> 422 <h4>NamingStyleChecker.__classVariableCheck</h4>
425 <b>__classVariableCheck</b>(<i>name</i>) 423 <b>__classVariableCheck</b>(<i>name</i>)
426
427 <p> 424 <p>
428 Private method to determine the error code for a variable in class scope. 425 Private method to determine the error code for a variable in class scope.
429 </p> 426 </p>
427
430 <dl> 428 <dl>
431 429
432 <dt><i>name</i> (str)</dt> 430 <dt><i>name</i> (str)</dt>
433 <dd> 431 <dd>
434 variable name to be checked 432 variable name to be checked
447 </dd> 445 </dd>
448 </dl> 446 </dl>
449 <a NAME="NamingStyleChecker.__error" ID="NamingStyleChecker.__error"></a> 447 <a NAME="NamingStyleChecker.__error" ID="NamingStyleChecker.__error"></a>
450 <h4>NamingStyleChecker.__error</h4> 448 <h4>NamingStyleChecker.__error</h4>
451 <b>__error</b>(<i>node, code</i>) 449 <b>__error</b>(<i>node, code</i>)
452
453 <p> 450 <p>
454 Private method to build the error information. 451 Private method to build the error information.
455 </p> 452 </p>
453
456 <dl> 454 <dl>
457 455
458 <dt><i>node</i> (ast.AST)</dt> 456 <dt><i>node</i> (ast.AST)</dt>
459 <dd> 457 <dd>
460 AST node to report an error for 458 AST node to report an error for
477 </dd> 475 </dd>
478 </dl> 476 </dl>
479 <a NAME="NamingStyleChecker.__extractNames" ID="NamingStyleChecker.__extractNames"></a> 477 <a NAME="NamingStyleChecker.__extractNames" ID="NamingStyleChecker.__extractNames"></a>
480 <h4>NamingStyleChecker.__extractNames</h4> 478 <h4>NamingStyleChecker.__extractNames</h4>
481 <b>__extractNames</b>(<i>assignmentTarget</i>) 479 <b>__extractNames</b>(<i>assignmentTarget</i>)
482
483 <p> 480 <p>
484 Private method to extract the names from the target node. 481 Private method to extract the names from the target node.
485 </p> 482 </p>
483
486 <dl> 484 <dl>
487 485
488 <dt><i>assignmentTarget</i> (ast.Name, ast.Tuple, ast.List or ast.ExceptHandler)</dt> 486 <dt><i>assignmentTarget</i> (ast.Name, ast.Tuple, ast.List or ast.ExceptHandler)</dt>
489 <dd> 487 <dd>
490 target node of the assignment 488 target node of the assignment
503 </dd> 501 </dd>
504 </dl> 502 </dl>
505 <a NAME="NamingStyleChecker.__findGlobalDefs" ID="NamingStyleChecker.__findGlobalDefs"></a> 503 <a NAME="NamingStyleChecker.__findGlobalDefs" ID="NamingStyleChecker.__findGlobalDefs"></a>
506 <h4>NamingStyleChecker.__findGlobalDefs</h4> 504 <h4>NamingStyleChecker.__findGlobalDefs</h4>
507 <b>__findGlobalDefs</b>(<i>functionNode</i>) 505 <b>__findGlobalDefs</b>(<i>functionNode</i>)
508
509 <p> 506 <p>
510 Private method amend a node with global definitions information. 507 Private method amend a node with global definitions information.
511 </p> 508 </p>
509
512 <dl> 510 <dl>
513 511
514 <dt><i>functionNode</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt> 512 <dt><i>functionNode</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt>
515 <dd> 513 <dd>
516 AST tree node to amend 514 AST tree node to amend
517 </dd> 515 </dd>
518 </dl> 516 </dl>
519 <a NAME="NamingStyleChecker.__findVariableNameErrors" ID="NamingStyleChecker.__findVariableNameErrors"></a> 517 <a NAME="NamingStyleChecker.__findVariableNameErrors" ID="NamingStyleChecker.__findVariableNameErrors"></a>
520 <h4>NamingStyleChecker.__findVariableNameErrors</h4> 518 <h4>NamingStyleChecker.__findVariableNameErrors</h4>
521 <b>__findVariableNameErrors</b>(<i>assignmentTarget, parents</i>) 519 <b>__findVariableNameErrors</b>(<i>assignmentTarget, parents</i>)
522
523 <p> 520 <p>
524 Private method to check, if there is a variable name error. 521 Private method to check, if there is a variable name error.
525 </p> 522 </p>
523
526 <dl> 524 <dl>
527 525
528 <dt><i>assignmentTarget</i> (ast.Name, ast.Tuple, ast.List or ast.ExceptHandler)</dt> 526 <dt><i>assignmentTarget</i> (ast.Name, ast.Tuple, ast.List or ast.ExceptHandler)</dt>
529 <dd> 527 <dd>
530 target node of the assignment 528 target node of the assignment
547 </dd> 545 </dd>
548 </dl> 546 </dl>
549 <a NAME="NamingStyleChecker.__functionVariableCheck" ID="NamingStyleChecker.__functionVariableCheck"></a> 547 <a NAME="NamingStyleChecker.__functionVariableCheck" ID="NamingStyleChecker.__functionVariableCheck"></a>
550 <h4>NamingStyleChecker.__functionVariableCheck</h4> 548 <h4>NamingStyleChecker.__functionVariableCheck</h4>
551 <b>__functionVariableCheck</b>(<i>func, varName</i>) 549 <b>__functionVariableCheck</b>(<i>func, varName</i>)
552
553 <p> 550 <p>
554 Private method to determine the error code for a variable in class scope. 551 Private method to determine the error code for a variable in class scope.
555 </p> 552 </p>
553
556 <dl> 554 <dl>
557 555
558 <dt><i>func</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt> 556 <dt><i>func</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt>
559 <dd> 557 <dd>
560 reference to the function definition node 558 reference to the function definition node
577 </dd> 575 </dd>
578 </dl> 576 </dl>
579 <a NAME="NamingStyleChecker.__getArgNames" ID="NamingStyleChecker.__getArgNames"></a> 577 <a NAME="NamingStyleChecker.__getArgNames" ID="NamingStyleChecker.__getArgNames"></a>
580 <h4>NamingStyleChecker.__getArgNames</h4> 578 <h4>NamingStyleChecker.__getArgNames</h4>
581 <b>__getArgNames</b>(<i>node</i>) 579 <b>__getArgNames</b>(<i>node</i>)
582
583 <p> 580 <p>
584 Private method to get the argument names of a function node. 581 Private method to get the argument names of a function node.
585 </p> 582 </p>
583
586 <dl> 584 <dl>
587 585
588 <dt><i>node</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt> 586 <dt><i>node</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt>
589 <dd> 587 <dd>
590 AST node to extract arguments names from 588 AST node to extract arguments names from
603 </dd> 601 </dd>
604 </dl> 602 </dl>
605 <a NAME="NamingStyleChecker.__getClassdef" ID="NamingStyleChecker.__getClassdef"></a> 603 <a NAME="NamingStyleChecker.__getClassdef" ID="NamingStyleChecker.__getClassdef"></a>
606 <h4>NamingStyleChecker.__getClassdef</h4> 604 <h4>NamingStyleChecker.__getClassdef</h4>
607 <b>__getClassdef</b>(<i>name, parents</i>) 605 <b>__getClassdef</b>(<i>name, parents</i>)
608
609 <p> 606 <p>
610 Private method to extract the class definition. 607 Private method to extract the class definition.
611 </p> 608 </p>
609
612 <dl> 610 <dl>
613 611
614 <dt><i>name</i> (str)</dt> 612 <dt><i>name</i> (str)</dt>
615 <dd> 613 <dd>
616 name of the class 614 name of the class
633 </dd> 631 </dd>
634 </dl> 632 </dl>
635 <a NAME="NamingStyleChecker.__globalVariableCheck" ID="NamingStyleChecker.__globalVariableCheck"></a> 633 <a NAME="NamingStyleChecker.__globalVariableCheck" ID="NamingStyleChecker.__globalVariableCheck"></a>
636 <h4>NamingStyleChecker.__globalVariableCheck</h4> 634 <h4>NamingStyleChecker.__globalVariableCheck</h4>
637 <b>__globalVariableCheck</b>(<i>name</i>) 635 <b>__globalVariableCheck</b>(<i>name</i>)
638
639 <p> 636 <p>
640 Private method to determine the error code for a variable in global scope. 637 Private method to determine the error code for a variable in global scope.
641 </p> 638 </p>
639
642 <dl> 640 <dl>
643 641
644 <dt><i>name</i> (str)</dt> 642 <dt><i>name</i> (str)</dt>
645 <dd> 643 <dd>
646 variable name to be checked 644 variable name to be checked
659 </dd> 657 </dd>
660 </dl> 658 </dl>
661 <a NAME="NamingStyleChecker.__isMixedCase" ID="NamingStyleChecker.__isMixedCase"></a> 659 <a NAME="NamingStyleChecker.__isMixedCase" ID="NamingStyleChecker.__isMixedCase"></a>
662 <h4>NamingStyleChecker.__isMixedCase</h4> 660 <h4>NamingStyleChecker.__isMixedCase</h4>
663 <b>__isMixedCase</b>(<i>name</i>) 661 <b>__isMixedCase</b>(<i>name</i>)
664
665 <p> 662 <p>
666 Private method to check, if the given name is mixed case. 663 Private method to check, if the given name is mixed case.
667 </p> 664 </p>
665
668 <dl> 666 <dl>
669 667
670 <dt><i>name</i> (str)</dt> 668 <dt><i>name</i> (str)</dt>
671 <dd> 669 <dd>
672 variable name to be checked 670 variable name to be checked
685 </dd> 683 </dd>
686 </dl> 684 </dl>
687 <a NAME="NamingStyleChecker.__isNameToBeAvoided" ID="NamingStyleChecker.__isNameToBeAvoided"></a> 685 <a NAME="NamingStyleChecker.__isNameToBeAvoided" ID="NamingStyleChecker.__isNameToBeAvoided"></a>
688 <h4>NamingStyleChecker.__isNameToBeAvoided</h4> 686 <h4>NamingStyleChecker.__isNameToBeAvoided</h4>
689 <b>__isNameToBeAvoided</b>(<i>name</i>) 687 <b>__isNameToBeAvoided</b>(<i>name</i>)
690
691 <p> 688 <p>
692 Private method to check, if the given name should be avoided. 689 Private method to check, if the given name should be avoided.
693 </p> 690 </p>
691
694 <dl> 692 <dl>
695 693
696 <dt><i>name</i> (str)</dt> 694 <dt><i>name</i> (str)</dt>
697 <dd> 695 <dd>
698 name to be checked 696 name to be checked
711 </dd> 709 </dd>
712 </dl> 710 </dl>
713 <a NAME="NamingStyleChecker.__isNamedTupel" ID="NamingStyleChecker.__isNamedTupel"></a> 711 <a NAME="NamingStyleChecker.__isNamedTupel" ID="NamingStyleChecker.__isNamedTupel"></a>
714 <h4>NamingStyleChecker.__isNamedTupel</h4> 712 <h4>NamingStyleChecker.__isNamedTupel</h4>
715 <b>__isNamedTupel</b>(<i>nodeValue</i>) 713 <b>__isNamedTupel</b>(<i>nodeValue</i>)
716
717 <p> 714 <p>
718 Private method to check, if a node is a named tuple. 715 Private method to check, if a node is a named tuple.
719 </p> 716 </p>
717
720 <dl> 718 <dl>
721 719
722 <dt><i>nodeValue</i> (ast.AST)</dt> 720 <dt><i>nodeValue</i> (ast.AST)</dt>
723 <dd> 721 <dd>
724 node to be checked 722 node to be checked
737 </dd> 735 </dd>
738 </dl> 736 </dl>
739 <a NAME="NamingStyleChecker.__superClassNames" ID="NamingStyleChecker.__superClassNames"></a> 737 <a NAME="NamingStyleChecker.__superClassNames" ID="NamingStyleChecker.__superClassNames"></a>
740 <h4>NamingStyleChecker.__superClassNames</h4> 738 <h4>NamingStyleChecker.__superClassNames</h4>
741 <b>__superClassNames</b>(<i>name, parents, names=None</i>) 739 <b>__superClassNames</b>(<i>name, parents, names=None</i>)
742
743 <p> 740 <p>
744 Private method to extract the names of all super classes. 741 Private method to extract the names of all super classes.
745 </p> 742 </p>
743
746 <dl> 744 <dl>
747 745
748 <dt><i>name</i> (str)</dt> 746 <dt><i>name</i> (str)</dt>
749 <dd> 747 <dd>
750 name of the class 748 name of the class
771 </dd> 769 </dd>
772 </dl> 770 </dl>
773 <a NAME="NamingStyleChecker.__tagClassFunctions" ID="NamingStyleChecker.__tagClassFunctions"></a> 771 <a NAME="NamingStyleChecker.__tagClassFunctions" ID="NamingStyleChecker.__tagClassFunctions"></a>
774 <h4>NamingStyleChecker.__tagClassFunctions</h4> 772 <h4>NamingStyleChecker.__tagClassFunctions</h4>
775 <b>__tagClassFunctions</b>(<i>classNode</i>) 773 <b>__tagClassFunctions</b>(<i>classNode</i>)
776
777 <p> 774 <p>
778 Private method to tag functions if they are methods, class methods or 775 Private method to tag functions if they are methods, class methods or
779 static methods. 776 static methods.
780 </p> 777 </p>
778
781 <dl> 779 <dl>
782 780
783 <dt><i>classNode</i> (ast.ClassDef)</dt> 781 <dt><i>classNode</i> (ast.ClassDef)</dt>
784 <dd> 782 <dd>
785 AST tree node to tag 783 AST tree node to tag
786 </dd> 784 </dd>
787 </dl> 785 </dl>
788 <a NAME="NamingStyleChecker.__visitNode" ID="NamingStyleChecker.__visitNode"></a> 786 <a NAME="NamingStyleChecker.__visitNode" ID="NamingStyleChecker.__visitNode"></a>
789 <h4>NamingStyleChecker.__visitNode</h4> 787 <h4>NamingStyleChecker.__visitNode</h4>
790 <b>__visitNode</b>(<i>node</i>) 788 <b>__visitNode</b>(<i>node</i>)
791
792 <p> 789 <p>
793 Private method to inspect the given AST node. 790 Private method to inspect the given AST node.
794 </p> 791 </p>
792
795 <dl> 793 <dl>
796 794
797 <dt><i>node</i> (ast.AST)</dt> 795 <dt><i>node</i> (ast.AST)</dt>
798 <dd> 796 <dd>
799 AST tree node to inspect 797 AST tree node to inspect
812 </dd> 810 </dd>
813 </dl> 811 </dl>
814 <a NAME="NamingStyleChecker.__visitTree" ID="NamingStyleChecker.__visitTree"></a> 812 <a NAME="NamingStyleChecker.__visitTree" ID="NamingStyleChecker.__visitTree"></a>
815 <h4>NamingStyleChecker.__visitTree</h4> 813 <h4>NamingStyleChecker.__visitTree</h4>
816 <b>__visitTree</b>(<i>node</i>) 814 <b>__visitTree</b>(<i>node</i>)
817
818 <p> 815 <p>
819 Private method to scan the given AST tree. 816 Private method to scan the given AST tree.
820 </p> 817 </p>
818
821 <dl> 819 <dl>
822 820
823 <dt><i>node</i> (ast.AST)</dt> 821 <dt><i>node</i> (ast.AST)</dt>
824 <dd> 822 <dd>
825 AST tree node to scan 823 AST tree node to scan
838 </dd> 836 </dd>
839 </dl> 837 </dl>
840 <a NAME="NamingStyleChecker.run" ID="NamingStyleChecker.run"></a> 838 <a NAME="NamingStyleChecker.run" ID="NamingStyleChecker.run"></a>
841 <h4>NamingStyleChecker.run</h4> 839 <h4>NamingStyleChecker.run</h4>
842 <b>run</b>(<i></i>) 840 <b>run</b>(<i></i>)
843
844 <p> 841 <p>
845 Public method run by the pycodestyle.py checker. 842 Public method run by the pycodestyle.py checker.
846 </p> 843 </p>
844
847 <dl> 845 <dl>
848 <dt>Return:</dt> 846 <dt>Return:</dt>
849 <dd> 847 <dd>
850 tuple giving line number, offset within line, code and 848 tuple giving line number, offset within line, code and
851 checker function 849 checker function

eric ide

mercurial