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

Christian Birkl christian.birkl at gmail.com
Wed Aug 30 15:44:41 EDT 2006

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060830/e192d092/attachment.html 

More information about the Mono-devel-list mailing list