[cheesecake-users] Comments on the index

Noel O'Boyle no228 at cam.ac.uk
Wed Jun 21 03:28:28 PDT 2006


Hello all,

Thanks Grig and Michal, first of all, for providing guidelines on good
kwalitee. People who know it all already are going to complain, because
they don't want to be told how they should do X or Y. However,
non-experts desperately need something like this.

I asked a question about this on comp.lang.python almost a year ago, and
didn't get any definitive answer, which made it difficult to decide what
to do:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/a72040485ced988/0959cca18770abed?q=baoilleach&rnum=1#0959cca18770abed

In any case, thanks again for being Benevolent Dictators of Style. We
need this.

Although calculating and recalculating the cheeseshop index has helped
me to design my package in a more standard way, I want to mention two
things that I think you should consider:
(1) I have been running pylint and fixing as many problems as possible
for each file in my program, so that my pylint score keeps increasing.
However, when I calculate the cheeseshop index, sometimes I see drops
and sometimes things just stay the same. The relevant lines are those
relating to the pylint scores for different revisions of my code:
index_pylint ............................  28 (average score is 2.76 out of 10)
index_pylint ............................  33 (average score is 3.21 out of 10)
index_pylint ............................  33 (average score is 3.21 out of 10)
index_pylint ............................  48 (average score is 4.71 out of 10)
index_pylint ............................  45 (average score is 4.48 out of 10)
index_pylint ............................  61 (average score is 6.10 out of 10)
index_pylint ............................  60 (average score is 5.91 out of 10)

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.

(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?

Regards,
  Noel




More information about the cheesecake-users mailing list