Quantcast

enforcer: Differentiate between INFO, WARNING and ERROR per rule

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

enforcer: Differentiate between INFO, WARNING and ERROR per rule

Mirko Friedenhagen-2
Hello,

http://jira.codehaus.org/browse/MENFORCER-124 suggests a "Rule-scoped
fail property" as feature. My suggestion would be something like this:
- Add an optional qualifier per rule which differentiates between
INFO, WARNING and ERROR (same as the loglevels) and
- Make the rules log with this level on the console and
- Make the build optionally fail only if there were violations with
log level ERROR.

For backward compatibility when no qualifier is given, rules will
default to ERROR.

What do you think?

Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/
https://bitbucket.org/mfriedenhagen/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: enforcer: Differentiate between INFO, WARNING and ERROR per rule

Mirko Friedenhagen-2
No thoughts about this? Should I just create a new ticket for this :-)?
Regards Mirko

On Wed, Mar 7, 2012 at 21:16, Mirko Friedenhagen
<[hidden email]> wrote:

> Hello,
>
> http://jira.codehaus.org/browse/MENFORCER-124 suggests a "Rule-scoped
> fail property" as feature. My suggestion would be something like this:
> - Add an optional qualifier per rule which differentiates between
> INFO, WARNING and ERROR (same as the loglevels) and
> - Make the rules log with this level on the console and
> - Make the build optionally fail only if there were violations with
> log level ERROR.
>
> For backward compatibility when no qualifier is given, rules will
> default to ERROR.
>
> What do you think?
>
> Regards Mirko
> --
> http://illegalstateexception.blogspot.com/
> https://github.com/mfriedenhagen/
> https://bitbucket.org/mfriedenhagen/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: enforcer: Differentiate between INFO, WARNING and ERROR per rule

Robert Scholte-3
Hi Mirko,

So if I understand you correctly you want to specify if a rule should be  
considered as a warning or an error.
And you want to specify if the enforcer-plugin should failOnError(default)  
or failOnWarning.
IMHO enforcer rules should always succeed.
Looking at the standard rules[1] I don't see one which should just warn.
Which use case did you have in mind?

-Robert

[1] http://maven.apache.org/enforcer/enforcer-rules/index.html

Op Tue, 13 Mar 2012 21:31:12 +0100 schreef Mirko Friedenhagen  
<[hidden email]>:

> No thoughts about this? Should I just create a new ticket for this :-)?
> Regards Mirko
>
> On Wed, Mar 7, 2012 at 21:16, Mirko Friedenhagen
> <[hidden email]> wrote:
>> Hello,
>>
>> http://jira.codehaus.org/browse/MENFORCER-124 suggests a "Rule-scoped
>> fail property" as feature. My suggestion would be something like this:
>> - Add an optional qualifier per rule which differentiates between
>> INFO, WARNING and ERROR (same as the loglevels) and
>> - Make the rules log with this level on the console and
>> - Make the build optionally fail only if there were violations with
>> log level ERROR.
>>
>> For backward compatibility when no qualifier is given, rules will
>> default to ERROR.
>>
>> What do you think?
>>
>> Regards Mirko
>> --
>> http://illegalstateexception.blogspot.com/
>> https://github.com/mfriedenhagen/
>> https://bitbucket.org/mfriedenhagen/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: enforcer: Differentiate between INFO, WARNING and ERROR per rule

Mirko Friedenhagen-2
Hello Robert,

yes, the failOnError(default=true) and failOnWarning(default=warn) is
what I had in mind. E.g.
http://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html
is making me headaches.

While I see ideally maven should fail if dependencies diverge
especially for libraries, having unittests all over the place for an
application is often sufficient and applications integrating loads of
dependencies by default, failing in the case of successful unit and
integration tests would be a bit heavy IMO. And maybe while releasing
I want to enforce stricter rules than during development.

On a side note: the requireProperty rule would become more handy, when
I could specify that projects inheriting from a global company parent
pom had to define a differing value from that set in the company pom
to enforce a policy that the pom url is pointing to another wiki page,
e.g.

Regards Mirko

On Wed, Mar 14, 2012 at 18:28, Robert Scholte <[hidden email]> wrote:

> Hi Mirko,
>
> So if I understand you correctly you want to specify if a rule should be
> considered as a warning or an error.
> And you want to specify if the enforcer-plugin should failOnError(default)
> or failOnWarning.
> IMHO enforcer rules should always succeed.
> Looking at the standard rules[1] I don't see one which should just warn.
> Which use case did you have in mind?
>
> -Robert
>
> [1] http://maven.apache.org/enforcer/enforcer-rules/index.html
>
> Op Tue, 13 Mar 2012 21:31:12 +0100 schreef Mirko Friedenhagen
> <[hidden email]>:
>
>> No thoughts about this? Should I just create a new ticket for this :-)?
>> Regards Mirko
>>
>> On Wed, Mar 7, 2012 at 21:16, Mirko Friedenhagen
>> <[hidden email]> wrote:
>>>
>>> Hello,
>>>
>>> http://jira.codehaus.org/browse/MENFORCER-124 suggests a "Rule-scoped
>>> fail property" as feature. My suggestion would be something like this:
>>> - Add an optional qualifier per rule which differentiates between
>>> INFO, WARNING and ERROR (same as the loglevels) and
>>> - Make the rules log with this level on the console and
>>> - Make the build optionally fail only if there were violations with
>>> log level ERROR.
>>>
>>> For backward compatibility when no qualifier is given, rules will
>>> default to ERROR.
>>>
>>> What do you think?
>>>
>>> Regards Mirko
>>> --
>>> http://illegalstateexception.blogspot.com/
>>> https://github.com/mfriedenhagen/
>>> https://bitbucket.org/mfriedenhagen/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: enforcer: Differentiate between INFO, WARNING and ERROR per rule

Robert Scholte-3
Hi Mirko,

I'd prefer to fix your pain in the rule itself, for example by adding the  
dependency-scope (if that would help).
About the release: it's already a critical process, so to add suddenly  
extra rules could be quite annoying.
Anyhow, you'll need to use a release-profile here, you're free to add  
extra enforcer rules there.
So I'm still not convinced.

-Robert

[1] http://jira.codehaus.org/browse/MENFORCER-118

Op Wed, 14 Mar 2012 20:58:36 +0100 schreef Mirko Friedenhagen  
<[hidden email]>:

> Hello Robert,
>
> yes, the failOnError(default=true) and failOnWarning(default=warn) is
> what I had in mind. E.g.
> http://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html
> is making me headaches.
>
> While I see ideally maven should fail if dependencies diverge
> especially for libraries, having unittests all over the place for an
> application is often sufficient and applications integrating loads of
> dependencies by default, failing in the case of successful unit and
> integration tests would be a bit heavy IMO. And maybe while releasing
> I want to enforce stricter rules than during development.
>
> On a side note: the requireProperty rule would become more handy, when
> I could specify that projects inheriting from a global company parent
> pom had to define a differing value from that set in the company pom
> to enforce a policy that the pom url is pointing to another wiki page,
> e.g.
>
> Regards Mirko
>
> On Wed, Mar 14, 2012 at 18:28, Robert Scholte <[hidden email]>  
> wrote:
>> Hi Mirko,
>>
>> So if I understand you correctly you want to specify if a rule should be
>> considered as a warning or an error.
>> And you want to specify if the enforcer-plugin should  
>> failOnError(default)
>> or failOnWarning.
>> IMHO enforcer rules should always succeed.
>> Looking at the standard rules[1] I don't see one which should just warn.
>> Which use case did you have in mind?
>>
>> -Robert
>>
>> [1] http://maven.apache.org/enforcer/enforcer-rules/index.html
>>
>> Op Tue, 13 Mar 2012 21:31:12 +0100 schreef Mirko Friedenhagen
>> <[hidden email]>:
>>
>>> No thoughts about this? Should I just create a new ticket for this :-)?
>>> Regards Mirko
>>>
>>> On Wed, Mar 7, 2012 at 21:16, Mirko Friedenhagen
>>> <[hidden email]> wrote:
>>>>
>>>> Hello,
>>>>
>>>> http://jira.codehaus.org/browse/MENFORCER-124 suggests a "Rule-scoped
>>>> fail property" as feature. My suggestion would be something like this:
>>>> - Add an optional qualifier per rule which differentiates between
>>>> INFO, WARNING and ERROR (same as the loglevels) and
>>>> - Make the rules log with this level on the console and
>>>> - Make the build optionally fail only if there were violations with
>>>> log level ERROR.
>>>>
>>>> For backward compatibility when no qualifier is given, rules will
>>>> default to ERROR.
>>>>
>>>> What do you think?
>>>>
>>>> Regards Mirko
>>>> --
>>>> http://illegalstateexception.blogspot.com/
>>>> https://github.com/mfriedenhagen/
>>>> https://bitbucket.org/mfriedenhagen/
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...