10436:f6881d10e995 | 10437:2f70ca07f0af |
---|---|
168 <p> | 168 <p> |
169 Constructor (according to 'extended' pycodestyle.py API) | 169 Constructor (according to 'extended' pycodestyle.py API) |
170 </p> | 170 </p> |
171 <dl> | 171 <dl> |
172 | 172 |
173 <dt><i>tree</i></dt> | 173 <dt><i>tree</i> (ast.AST)</dt> |
174 <dd> | 174 <dd> |
175 AST tree of the source file | 175 AST tree of the source file |
176 </dd> | 176 </dd> |
177 <dt><i>filename</i></dt> | 177 <dt><i>filename</i> (str)</dt> |
178 <dd> | 178 <dd> |
179 name of the source file (string) | 179 name of the source file |
180 </dd> | 180 </dd> |
181 <dt><i>options</i></dt> | 181 <dt><i>options</i> (optparse.Option)</dt> |
182 <dd> | 182 <dd> |
183 options as parsed by pycodestyle.StyleGuide | 183 options as parsed by pycodestyle.StyleGuide |
184 </dd> | 184 </dd> |
185 </dl> | 185 </dl> |
186 <a NAME="NamingStyleChecker.__checkClassName" ID="NamingStyleChecker.__checkClassName"></a> | 186 <a NAME="NamingStyleChecker.__checkClassName" ID="NamingStyleChecker.__checkClassName"></a> |
195 Almost without exception, class names use the CapWords convention. | 195 Almost without exception, class names use the CapWords convention. |
196 Classes for internal use have a leading underscore in addition. | 196 Classes for internal use have a leading underscore in addition. |
197 </p> | 197 </p> |
198 <dl> | 198 <dl> |
199 | 199 |
200 <dt><i>node</i></dt> | 200 <dt><i>node</i> (ast.ClassDef)</dt> |
201 <dd> | 201 <dd> |
202 AST note to check | 202 AST note to check |
203 </dd> | 203 </dd> |
204 <dt><i>parents</i></dt> | 204 <dt><i>parents</i> (list of ast.AST)</dt> |
205 <dd> | 205 <dd> |
206 list of parent nodes | 206 list of parent nodes |
207 </dd> | 207 </dd> |
208 </dl> | 208 </dl> |
209 <dl> | 209 <dl> |
231 separated by underscores. A class method should have 'cls' as the | 231 separated by underscores. A class method should have 'cls' as the |
232 first argument. A method should have 'self' as the first argument. | 232 first argument. A method should have 'self' as the first argument. |
233 </p> | 233 </p> |
234 <dl> | 234 <dl> |
235 | 235 |
236 <dt><i>node</i></dt> | 236 <dt><i>node</i> (ast.FunctionDef or ast.AsynFunctionDef)</dt> |
237 <dd> | 237 <dd> |
238 AST note to check | 238 AST note to check |
239 </dd> | 239 </dd> |
240 <dt><i>parents</i></dt> | 240 <dt><i>parents</i> (list of ast.AST)</dt> |
241 <dd> | 241 <dd> |
242 list of parent nodes | 242 list of parent nodes |
243 </dd> | 243 </dd> |
244 </dl> | 244 </dl> |
245 <dl> | 245 <dl> |
269 only in contexts where that's already the prevailing style | 269 only in contexts where that's already the prevailing style |
270 (e.g. threading.py), to retain backwards compatibility. | 270 (e.g. threading.py), to retain backwards compatibility. |
271 </p> | 271 </p> |
272 <dl> | 272 <dl> |
273 | 273 |
274 <dt><i>node</i></dt> | 274 <dt><i>node</i> (ast.FunctionDef or ast.AsynFunctionDef)</dt> |
275 <dd> | 275 <dd> |
276 AST note to check | 276 AST note to check |
277 </dd> | 277 </dd> |
278 <dt><i>parents</i></dt> | 278 <dt><i>parents</i> (list of ast.AST)</dt> |
279 <dd> | 279 <dd> |
280 list of parent nodes | 280 list of parent nodes |
281 </dd> | 281 </dd> |
282 </dl> | 282 </dl> |
283 <dl> | 283 <dl> |
300 Private method to check that imports don't change the | 300 Private method to check that imports don't change the |
301 naming convention (N811, N812, N813, N814, N815). | 301 naming convention (N811, N812, N813, N814, N815). |
302 </p> | 302 </p> |
303 <dl> | 303 <dl> |
304 | 304 |
305 <dt><i>node</i></dt> | 305 <dt><i>node</i> (ast.Import)</dt> |
306 <dd> | 306 <dd> |
307 AST note to check | 307 AST node to check |
308 </dd> | 308 </dd> |
309 <dt><i>parents</i></dt> | 309 <dt><i>parents</i> (list of ast.AST)</dt> |
310 <dd> | 310 <dd> |
311 list of parent nodes | 311 list of parent nodes |
312 </dd> | 312 </dd> |
313 </dl> | 313 </dl> |
314 <dl> | 314 <dl> |
333 <p> | 333 <p> |
334 Module and package names should be lowercase. | 334 Module and package names should be lowercase. |
335 </p> | 335 </p> |
336 <dl> | 336 <dl> |
337 | 337 |
338 <dt><i>node</i></dt> | 338 <dt><i>node</i> (ast.AST)</dt> |
339 <dd> | 339 <dd> |
340 AST note to check | 340 AST node to check |
341 </dd> | 341 </dd> |
342 <dt><i>parents</i></dt> | 342 <dt><i>parents</i> (list of ast.AST)</dt> |
343 <dd> | 343 <dd> |
344 list of parent nodes | 344 list of parent nodes |
345 </dd> | 345 </dd> |
346 </dl> | 346 </dl> |
347 <dl> | 347 <dl> |
363 <p> | 363 <p> |
364 Private class to check the given node for a name to be avoided (N831). | 364 Private class to check the given node for a name to be avoided (N831). |
365 </p> | 365 </p> |
366 <dl> | 366 <dl> |
367 | 367 |
368 <dt><i>node</i></dt> | 368 <dt><i>node</i> (ast.Ast)</dt> |
369 <dd> | 369 <dd> |
370 AST note to check | 370 AST note to check |
371 </dd> | 371 </dd> |
372 <dt><i>parents</i></dt> | 372 <dt><i>parents</i> (list of ast.AST)</dt> |
373 <dd> | 373 <dd> |
374 list of parent nodes | 374 list of parent nodes |
375 </dd> | 375 </dd> |
376 </dl> | 376 </dl> |
377 <dl> | 377 <dl> |
397 <p> | 397 <p> |
398 Local variables in functions should be lowercase. | 398 Local variables in functions should be lowercase. |
399 </p> | 399 </p> |
400 <dl> | 400 <dl> |
401 | 401 |
402 <dt><i>node</i></dt> | 402 <dt><i>node</i> (ast.AST)</dt> |
403 <dd> | 403 <dd> |
404 AST note to check | 404 AST note to check |
405 </dd> | 405 </dd> |
406 <dt><i>parents</i></dt> | 406 <dt><i>parents</i> (list of ast.AST)</dt> |
407 <dd> | 407 <dd> |
408 list of parent nodes | 408 list of parent nodes |
409 </dd> | 409 </dd> |
410 </dl> | 410 </dl> |
411 <dl> | 411 <dl> |
453 <p> | 453 <p> |
454 Private method to build the error information. | 454 Private method to build the error information. |
455 </p> | 455 </p> |
456 <dl> | 456 <dl> |
457 | 457 |
458 <dt><i>node</i></dt> | 458 <dt><i>node</i> (ast.AST)</dt> |
459 <dd> | 459 <dd> |
460 AST node to report an error for | 460 AST node to report an error for |
461 </dd> | 461 </dd> |
462 <dt><i>code</i></dt> | 462 <dt><i>code</i> (str)</dt> |
463 <dd> | 463 <dd> |
464 error code to report (string) | 464 error code to report |
465 </dd> | 465 </dd> |
466 </dl> | 466 </dl> |
467 <dl> | 467 <dl> |
468 <dt>Return:</dt> | 468 <dt>Return:</dt> |
469 <dd> | 469 <dd> |
470 tuple giving line number, offset within line and error code | 470 tuple giving line number, offset within line and error code |
471 (integer, integer, string) | 471 </dd> |
472 </dl> | |
473 <dl> | |
474 <dt>Return Type:</dt> | |
475 <dd> | |
476 tuple of (int, int, str) | |
472 </dd> | 477 </dd> |
473 </dl> | 478 </dl> |
474 <a NAME="NamingStyleChecker.__extractNames" ID="NamingStyleChecker.__extractNames"></a> | 479 <a NAME="NamingStyleChecker.__extractNames" ID="NamingStyleChecker.__extractNames"></a> |
475 <h4>NamingStyleChecker.__extractNames</h4> | 480 <h4>NamingStyleChecker.__extractNames</h4> |
476 <b>__extractNames</b>(<i>assignmentTarget</i>) | 481 <b>__extractNames</b>(<i>assignmentTarget</i>) |
504 <p> | 509 <p> |
505 Private method amend a node with global definitions information. | 510 Private method amend a node with global definitions information. |
506 </p> | 511 </p> |
507 <dl> | 512 <dl> |
508 | 513 |
509 <dt><i>functionNode</i></dt> | 514 <dt><i>functionNode</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt> |
510 <dd> | 515 <dd> |
511 AST tree node to amend | 516 AST tree node to amend |
512 </dd> | 517 </dd> |
513 </dl> | 518 </dl> |
514 <a NAME="NamingStyleChecker.__findVariableNameErrors" ID="NamingStyleChecker.__findVariableNameErrors"></a> | 519 <a NAME="NamingStyleChecker.__findVariableNameErrors" ID="NamingStyleChecker.__findVariableNameErrors"></a> |
578 <p> | 583 <p> |
579 Private method to get the argument names of a function node. | 584 Private method to get the argument names of a function node. |
580 </p> | 585 </p> |
581 <dl> | 586 <dl> |
582 | 587 |
583 <dt><i>node</i></dt> | 588 <dt><i>node</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt> |
584 <dd> | 589 <dd> |
585 AST node to extract arguments names from | 590 AST node to extract arguments names from |
586 </dd> | 591 </dd> |
587 </dl> | 592 </dl> |
588 <dl> | 593 <dl> |
589 <dt>Return:</dt> | 594 <dt>Return:</dt> |
590 <dd> | 595 <dd> |
591 list of argument names (list of string) | 596 list of argument names |
597 </dd> | |
598 </dl> | |
599 <dl> | |
600 <dt>Return Type:</dt> | |
601 <dd> | |
602 list of str | |
592 </dd> | 603 </dd> |
593 </dl> | 604 </dl> |
594 <a NAME="NamingStyleChecker.__getClassdef" ID="NamingStyleChecker.__getClassdef"></a> | 605 <a NAME="NamingStyleChecker.__getClassdef" ID="NamingStyleChecker.__getClassdef"></a> |
595 <h4>NamingStyleChecker.__getClassdef</h4> | 606 <h4>NamingStyleChecker.__getClassdef</h4> |
596 <b>__getClassdef</b>(<i>name, parents</i>) | 607 <b>__getClassdef</b>(<i>name, parents</i>) |
602 | 613 |
603 <dt><i>name</i> (str)</dt> | 614 <dt><i>name</i> (str)</dt> |
604 <dd> | 615 <dd> |
605 name of the class | 616 name of the class |
606 </dd> | 617 </dd> |
607 <dt><i>parents</i> (ast.AST)</dt> | 618 <dt><i>parents</i> (list of ast.AST)</dt> |
608 <dd> | 619 <dd> |
609 list of parent nodes | 620 list of parent nodes |
610 </dd> | 621 </dd> |
611 </dl> | 622 </dl> |
612 <dl> | 623 <dl> |
680 <p> | 691 <p> |
681 Private method to check, if the given name should be avoided. | 692 Private method to check, if the given name should be avoided. |
682 </p> | 693 </p> |
683 <dl> | 694 <dl> |
684 | 695 |
685 <dt><i>name</i></dt> | 696 <dt><i>name</i> (str)</dt> |
686 <dd> | 697 <dd> |
687 name to be checked (string) | 698 name to be checked |
688 </dd> | 699 </dd> |
689 </dl> | 700 </dl> |
690 <dl> | 701 <dl> |
691 <dt>Return:</dt> | 702 <dt>Return:</dt> |
692 <dd> | 703 <dd> |
693 flag indicating to avoid it (boolen) | 704 flag indicating to avoid it |
705 </dd> | |
706 </dl> | |
707 <dl> | |
708 <dt>Return Type:</dt> | |
709 <dd> | |
710 bool | |
694 </dd> | 711 </dd> |
695 </dl> | 712 </dl> |
696 <a NAME="NamingStyleChecker.__isNamedTupel" ID="NamingStyleChecker.__isNamedTupel"></a> | 713 <a NAME="NamingStyleChecker.__isNamedTupel" ID="NamingStyleChecker.__isNamedTupel"></a> |
697 <h4>NamingStyleChecker.__isNamedTupel</h4> | 714 <h4>NamingStyleChecker.__isNamedTupel</h4> |
698 <b>__isNamedTupel</b>(<i>nodeValue</i>) | 715 <b>__isNamedTupel</b>(<i>nodeValue</i>) |
730 | 747 |
731 <dt><i>name</i> (str)</dt> | 748 <dt><i>name</i> (str)</dt> |
732 <dd> | 749 <dd> |
733 name of the class | 750 name of the class |
734 </dd> | 751 </dd> |
735 <dt><i>parents</i> (ast.AST)</dt> | 752 <dt><i>parents</i> (list of ast.AST)</dt> |
736 <dd> | 753 <dd> |
737 list of parent nodes | 754 list of parent nodes |
738 </dd> | 755 </dd> |
739 <dt><i>names</i> (set of str (optional))</dt> | 756 <dt><i>names</i> (set of str (optional))</dt> |
740 <dd> | 757 <dd> |
761 Private method to tag functions if they are methods, class methods or | 778 Private method to tag functions if they are methods, class methods or |
762 static methods. | 779 static methods. |
763 </p> | 780 </p> |
764 <dl> | 781 <dl> |
765 | 782 |
766 <dt><i>classNode</i></dt> | 783 <dt><i>classNode</i> (ast.ClassDef)</dt> |
767 <dd> | 784 <dd> |
768 AST tree node to tag | 785 AST tree node to tag |
769 </dd> | 786 </dd> |
770 </dl> | 787 </dl> |
771 <a NAME="NamingStyleChecker.__visitNode" ID="NamingStyleChecker.__visitNode"></a> | 788 <a NAME="NamingStyleChecker.__visitNode" ID="NamingStyleChecker.__visitNode"></a> |
775 <p> | 792 <p> |
776 Private method to inspect the given AST node. | 793 Private method to inspect the given AST node. |
777 </p> | 794 </p> |
778 <dl> | 795 <dl> |
779 | 796 |
780 <dt><i>node</i></dt> | 797 <dt><i>node</i> (ast.AST)</dt> |
781 <dd> | 798 <dd> |
782 AST tree node to inspect | 799 AST tree node to inspect |
783 </dd> | 800 </dd> |
784 </dl> | 801 </dl> |
785 <dl> | 802 <dl> |
801 <p> | 818 <p> |
802 Private method to scan the given AST tree. | 819 Private method to scan the given AST tree. |
803 </p> | 820 </p> |
804 <dl> | 821 <dl> |
805 | 822 |
806 <dt><i>node</i></dt> | 823 <dt><i>node</i> (ast.AST)</dt> |
807 <dd> | 824 <dd> |
808 AST tree node to scan | 825 AST tree node to scan |
809 </dd> | 826 </dd> |
810 </dl> | 827 </dl> |
811 <dl> | 828 <dl> |
832 <dd> | 849 <dd> |
833 tuple giving line number, offset within line, code and | 850 tuple giving line number, offset within line, code and |
834 checker function | 851 checker function |
835 </dd> | 852 </dd> |
836 </dl> | 853 </dl> |
854 <dl> | |
855 <dt>Return Type:</dt> | |
856 <dd> | |
857 tuple of (int, int, str, function) | |
858 </dd> | |
859 </dl> | |
837 <div align="right"><a href="#top">Up</a></div> | 860 <div align="right"><a href="#top">Up</a></div> |
838 <hr /> | 861 <hr /> |
839 </body></html> | 862 </body></html> |