On 18 Sep 2015, at 08:34, Marcus Denker <marcus.denker@inria.fr> wrote:
Maybe we can hijack that mechanism with a class side method e.g.
rbNotReferenced <lint>
Do your modifications test sends of subclassesDo: and friends?
OR
#(#MyClass1 #MyClass2 #MyClass3) collect:[:ea | (Smalltalk at: ea) doSomething].
The reason I ask is I'm planning to do a bunch of cleanup of a package and it would be nice to not worry about those cases getting missed
What I did is to implement #isUsed like this in e.g the hierarchy of RBLintRule:
isUsed "all my sublasses are used" ^self name ~= âRBLintRule'
this way if RBLintRule is not used, it is seen by the Critique, but all subclasses are used by default.
I implemented that in TestCase, too, and removed the explicit check for TestCase subclasses from the rule.
This is a nice thing. In the same way we can deal with abstract classes. So if someone develops an abstract class with an intent to use it, he can specify that itâs ok to use the class. Also is there any work on pragmas for classes, at some point Iâve heard something about it but canât recall. I will try to hack a bit this weekend and see if I can add some kind of automation to marking a class as used. I.e. if you see a critic, you should be able to mark the class as being used with 1-2 clicks. If you are developing some king of facade, you should know that you will not reference it from your library. Uko
Marcus