On 1/10/07, goff <[EMAIL PROTECTED]> wrote: > > Hi, > after everybody and their dog discussed the size of their screens, I > would like to reraise the question of the pylint support. I just > started to feed my model.py to it and had an initial rating of -16.3 - > a good start :-) > > I got rid of all errors and warnings, but some of the things I had to > do where not quite to my liking: > > --disable-msg=E1101: > This is because pylint doesnt find the _SO_[gs]et_attribute methods > that SQLObject creates. the pylint side claims to support metaclasses, > so I dont know why it doesnt find these methods. > > --max-public-methods=30 (instead of 20) > more than half of my SQLObjects had more than 20 methods ... > > --min-public-methods=0 > ... and the inner sqlmeta classes have no methods at all. BTW, I > changed all sqlmeta's to new style classes to get rid of W0232: class > has no __init__ method > > --no-docstring-rgx=(__.*__)|(sqlmeta)|(_[gs]et_.*) > this fixes C0111 for all sqlmetas and overloaded attribute getters > and setters. > > --class-rgx=([A-Z_][a-zA-Z0-9]+)|(sqlmeta)$ > again sqlmeta had to be handled specially > > I also added --include-ids to the settings, just to clutter the output. > And I changed > from sqlobject import * > to > from sqlobject import SQLObject > from sqlobject.col import IntCol, StringCol, DateCol, DateTimeCol, > BoolCol > from sqlobject.col import ForeignKey, UnicodeCol, EnumCol > from sqlobject.joins import MultipleJoin, RelatedJoin > from sqlobject.inheritance import InheritableSQLObject > from sqlobject.index import DatabaseIndex > from sqlobject.main import SQLObjectNotFound > from sqlobject.sqlbuilder import OR > Remember: Explicit is better than implicit. Most of the times. The > alternative would be to have > --disable-msg=E0602,W0232,W0401,W0611 > do get rid of the 56 E0602, 1 W0232, 1 W0401 and 33 W0611 my model > would produce otherwise ... > > Oh, and I break my code lines at 80 columns, thank you :-) > Nice, I was just getting ready to try the same thing. Nice that you beat me to it. I'd like to see the tg code base be able to pylint out well too. However, it's going to take core support and someone committing the changes for it to happen.
I've just started cutting my teeth by submitting patches for some trivial stuff in the trac. Ultimate goal is to help out in tasks like this come up. Do you use the standard pylint config or do you make some modifications? I try to stick to the standard config myself. -Jeff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

