[Pharo-dev] Clarifications with small lint rules

Yuriy Tymchuk yuriy.tymchuk at me.com
Thu May 22 11:18:44 EDT 2014


Hi Jan,

in #failedMethods: you use #failedMethodsInto: which is abstract. So the idea is that in each rule gets methods from it’s result?

Uko


On 22 May 2014, at 17:03, Jan Vrany <jan.vrany at fit.cvut.cz> wrote:

> Yeah,
> 
> all the refatory stuff has weird API and SmallLint ones are of the weirdest. The design is bit unfortunate.
> You may want to have a look how I did it:
> 
> RBLintRule>>failedMethods, RBLintRule>>failedClasses
> 
> source code's here:
> http://www.exept.de/cgi-bin/viewvc.cgi/stx/goodies/refactoryBrowser/lint/RBLintRule.st?view=markup
> 
> Best, Jan
> 
> 
> On 22/05/14 15:49, Yuriy Tymchuk wrote:
>> Hi guys,
>> 
>> so I’m experimenting with rules, and I have one simple question: how do I get a collection of items from some environment which violate some rule?
>> 
>> i know that I can send #runOnEnvironment: to the rule itself and then it will use a checker to run the rule on the environment. But later I end up with the rule itself. I know that I can get all atomic rules from composite rule by sending #leaves, and there is #result method that returns environment. But there is no single way to get items from environment, and all accessors are environment-specific. Am I doing something wrong? Because I’ve spent half of a day to find out how to run a rule and get violations :).
>> 
>> Cheers.
>> Uko
>> 
> 
> 





More information about the Pharo-dev mailing list