[cheesecake-users] Comments on the index

Michał Kwiatkowski constant.beta at gmail.com
Wed Jun 21 07:20:32 PDT 2006


On 6/21/06, Noel O'Boyle <no228 at cam.ac.uk> wrote:
> In any case, thanks again for being Benevolent Dictators of Style. We
> need this.

Good to hear that. But I never supposed I'd get my BD title in such a
short time. ;-)

> The problem is that index_pylint is the average of the non-negative
> pylint scores. As a result, when I increase the quality of a
> negatively-scored code to bring it above zero (which *must* be an
> improvement) the index_pylint can potentially decrease. In the worst
> case, this encourages me to decrease the quality of all of my code to
> below zero, except for one shining example of perfect code.
>
> Perhaps a better measure would be the take the average over all of the
> files of max(0,pylint_score). This would encourage improvement in
> negatively-scored files.

In my opinion negative scores should be counted as well to the overall
score. Projects should be penalized for having really bad code inside.
We can exclude some corner cases, but IMHO both negative and positive
scores should be counted. Implementing this won't be hard. What do you
think, Grig?

> (2) I know that you don't make pylint, you just use it. However, you
> should be aware for it seems to discourage doctests...not a good thing,
> I think. Typically, modules that include doctests have a main section as
> follows:
> if __name__ == "__main__":
>     import doctest, thismodule
>     doctest.testmod(thismodule)
>
> pylint doesn't like modules to import themselves, but how else can you
> doctest?? Or can you suggest a different convention?

Thanks for pointing this out. Pylint checker still needs some major
improvements, I'm sure there are more checks that are either
irrelevant or are duplicating work we do separately in different
index. In my opinion, importing self is not that bad, and we can
safely ignore this warning from pylint. But in your specific case you
don't have to import self to use doctest. testmod method default is to
use current module. So a piece of code like this will suffice:

    import doctest
    doctest.testmod()

mk
-- 
 . o .       >>  http://joker.linuxstuff.pl  <<
 . . o   It's easier to get forgiveness for being wrong
 o o o   than forgiveness for being right.



More information about the cheesecake-users mailing list