Re: [Codenarc-user] ExplicitCallToAndMethodRule: allowing explicit "and" calls for various classes?
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2011-05-27 12:35:30
|
>> Is it possible to allow explicit "and" calls on different classes in the ExplicitCallToAndMethodRule? >> doNotApplyToClassNames cannot be used because this filters only the classes that are analyzed, not the ones, "and" is called on. >> We are using Hamcrest a lot. It has a fluent interface which can go like ... René, Adding exceptions based on the class types that are the parameters would not be practical, as you discovered, at least with the way CodeNarc currently parses the source code. As a workaround, I would just turn off the rule for all of your test classes. e.g., doNotApplyToClassNames = *Test,*Tests or if you do not have a naming convention for your test classes, then use doNotApplyToFileNames or doNotApplyToFilesMatching. Chris |