[anaconda:master 0/3] Using a pointless overrides checker
clumens at redhat.com
Wed Dec 3 21:29:55 UTC 2014
> The first patch is motivated by the results of the pointless overrides checker.
> The checker identifies somethings as pointless overrides which aren't really
> meant to be class attributes at all. It seemed sensible to just refactor all
> that path calculation into a staticmethod.
> The other two patches just add the pylint checker and then remove pointless
> overrides identified. The checker has to be used with some judgement in
> when there is multiple inheritance, which occurs with TUIObject, so I did
> have to check a few by hand. The restrictions of the checker are all
> documented in the comments.
I definitely like using pylint to catch more crud like this. It helps
improve the quality and clarity of the code by getting rid of things
that, like you said, are pointless.
I noticed a fairly busy nested loop or two in PointlessClassAttributeOverrideChecker,
which makes me wonder about the speediness. Do you have any feeling for
if it's going to run slowly at all? I guess in the case of just
checking a file or two in a commit it'd be fine, but what about running
across the entire source tree?
Regarding multiple inheritance - it appers we do it in 34 places, only
one of which is outside the UI. Within the UI, I think the worst
offender is the hub and spoke inheritance knot, followed then by
checkers. I don't believe those should cause problems.
More information about the anaconda-patches