[Mono-dev] gendarme: request for API breakage of I<Type>Rule

Sebastien Pouliot sebastien.pouliot at gmail.com
Tue Sep 19 19:30:30 EDT 2006


On Wed, 2006-08-30 at 21:44 +0200, Christian Birkl wrote:
> Hello all,
>  
> currently there are 4 interfaces for rules: IAssemblyRule,
> IModuleRule, ITypeRule and IMethodRule. Each one declares a method
> which looks like this:
>  
> IList Check<Type> (IAssemblyDefinition ad, ...);
>  
> The return value IList contains a list of objects. If this return
> value is null it means that there's no violation. If it is non null,
> then <Type> has violated this rule and the list may contain a list of
> objects with detailed information. Currently there are two types of
> information, a simple string (Example: "Found string: \r\n") or a
> complex object of type "Message" - but the interface allows a rule to
> return everything it wishes to return. This makes it really, really
> difficult for runners to determine what to "print" to the user since
> it doesn't know at designtime what a rule might return (imho missing
> type safety). Therefore I'd like to propose a change into a return
> value of a typed collection based on the Message object. 
>  
> An example might by:
>  
> IMessageCollection Check<Type> (IAssemblyDefinition ad, ...)
>  
> This would also eleminate the ability of using a string, which IMHO is
> good thing since now every rule needs to provide a text and location
> (like type and offset).
>  
> I'd like to here what other think of this change.

I'm open to such breaking change - even more if it comes with a patch to
update existing stuff we have ;-)
-- 
Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/




More information about the Mono-devel-list mailing list