Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "failOnViolation" setting to optionally fail builds #62

Merged
merged 2 commits into from
Aug 9, 2015
Merged

Add "failOnViolation" setting to optionally fail builds #62

merged 2 commits into from
Aug 9, 2015

Conversation

joschi
Copy link
Contributor

@joschi joschi commented Jul 29, 2015

Sometimes it is desired to let a build succeed, even if violations have been found (e. g. for a gradual roll-out of the forbidden-apis checker in builds).

The "failOnViolation" setting for the Ant task and the Maven Mojo enables the user to let their builds succeed even if violations have been found by the forbidden APIs checker.

This functionality is also provided by other broadly used static code analyzer plugins, like PMD, Checkstyle, and FindBugs.

Sometimes it is desired to let a build succeed, even if violations have been found.
The "failOnViolation" setting for the Ant task and the Maven Mojo enables the user
to let their builds succeed even if violations have been found by the forbidden APIs
checker.
@uschindler
Copy link
Member

Hi,
thanks for the PR! This looks perfect, you also added tests :-)
I will review and merge once I have some time. Currently I am on vacation,

Many thanks,
Uwe

@uschindler uschindler self-assigned this Jul 29, 2015
@uschindler uschindler added this to the 1.9 milestone Jul 29, 2015
@uschindler
Copy link
Member

We can maybe also add a "user property" for Maven (like PMD, Findbugs, Checkstyle). This is just a change in the annotation, so we can add this later. The user property is like -Dforbiddenapis.skip to override checks. This can be used e.g. while development to add System.out printlns for debugging, but forbiddenapis prevents you from running tests. So developer can quickly override, still showing the bugs (with skip its disabled completely)

@joschi
Copy link
Contributor Author

joschi commented Jul 30, 2015

@uschindler Good idea! I've added the system property "forbiddenapis.failOnViolation" (similar to "forbiddenapis.skip") to override the setting in Maven builds.

uschindler added a commit that referenced this pull request Aug 9, 2015
Add "failOnViolation" setting to optionally fail builds
@uschindler uschindler merged commit 24c39a3 into policeman-tools:master Aug 9, 2015
@uschindler
Copy link
Member

Thanks @joschi !

@joschi joschi deleted the optional-fail branch August 10, 2015 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants