Re: [Clirr-devel] Blog post on Clirr...
Status: Alpha
Brought to you by:
lkuehne
From: Brett P. <br...@ap...> - 2006-02-13 11:03:13
|
You have access to the ApiDifference class so can filter based on: - class - error number (type) - method / file - severity Currently, the m2 plugin supports class and severity. The 3rd seems the most useful to me. - Brett Vincent Massol wrote: > >> -----Original Message----- >> From: cli...@li... [mailto:clirr-devel- >> ad...@li...] On Behalf Of Simon Kitching >> Sent: lundi 13 février 2006 06:03 >> To: cli...@li... >> Cc: br...@ap... >> Subject: Re: [Clirr-devel] Blog post on Clirr... > > [snip] > >>> In my blog post I hint at a feature that I think could be improved in >> Clirr: >>> fine-grained exclusions, i.e. the ability to exclude a violation. Right >> now >>> I think the only possibility is to exclude a whole file, right? >> If you're talking about the clirr feature that allows a build to fail >> when an API has changed, then I think that would be an excellent >> addition. > > Yes that's what I mean. > > [snip] >> Any suggestion how these exceptions might be specified? eg >> --exclude classname:problemId >> That would exclude *all* occurrences of a particular problem type in >> that class, though, which is probably too much. Line numbers are >> probably not possible. Method-name is only applicable in some cases. > > I don't know. I haven't checked the java code but you must be using a way > identify violations, no? > > If not, then at worse we could simply using regexps to exclude things: > > * You would specify the following to exclude a specific error: > > "ERROR: 7002: org.codehaus.cargo.ant.CargoTask: Method 'protected > java.util.List getWars()' has been removed" > > * If you wanted to exclude all 7002 errors you would write: > > "ERROR: 7002:.*" > > * To exclude all errors related to class > "org.codehaus.cargo.ant.ConfigurationElement" you would write: > > "EROR: .*: org.codehaus.cargo.ant.ConfigurationElement: .*" > > Etc. > > I guess each error could also be categorized in 4 parts: > - the severity: ERROR, INFO, etc > - the error number > - the class impacted > - the message > > So, exclusions could be specified as: > > <exclusion> > <severity>ERROR</severity> > <error>7002</error> > </exclusion> > > (this would exclude all 7002 errors) > > <exclusion> > <severity>ERROR</severity> > <class> org.codehaus.cargo.ant.ConfigurationElement</class> > </exclusion> > > (this would exclude all errors impacting such class) > > <exclusion> > <severity>ERROR</severity> > <error>7002</error> > <class>org.codehaus.cargo.ant.CargoTask</class> > <message>Method 'protected java.util.List getWars()' has been > removed</message> > </exclusion> > > (this would remove a specific error) > > The message could also be normalized as follows: > > <exclusion> > <severity>ERROR</severity> > <error>7002</error> > <class>org.codehaus.cargo.ant.CargoTask</class> > <elements> > <element>protected java.util.List getWars()<element> > </elements> > </exclusion> > > For "ERROR: 7006: org.codehaus.cargo.container.spi.AbstractContainer: Return > type of method 'public org.codehaus.cargo.container.Configuration > getConfiguration()' has been changed to > org.codehaus.cargo.container.configuration.Configuration" you would write: > > <exclusion> > <severity>ERROR</severity> > <error>7006</error> > <class>org.codehaus.cargo.container.spi.AbstractContainer</class> > <elements> > <element>public org.codehaus.cargo.container.Configuration > getConfiguration()<element> > > <element>org.codehaus.cargo.container.configuration.Configuration</element> > </elements> > </exclusion> > > Etc > > Just some ideas... > > Thanks > -Vincent > |