Skip to content
This repository has been archived by the owner on Sep 17, 2020. It is now read-only.

Supporting 3-rd party detectors (rules) #16

Closed
wants to merge 1 commit into from

Conversation

volkovs
Copy link
Contributor

@volkovs volkovs commented Aug 23, 2016

We would like to write our own project specific rules. So, this is currently a working solution for Maven. I didn't tested Ant or Gradle, but should be as simple as adding your artifact (with custom detectors) to (HuntBugs plugin) classpath.

  • multiple messages.xml are read and merged
  • Java SPI mechanism for discovering 3-rd party detectors
  • default detector package is still needs to be used
  • huntbugs maven plugin is not affected (to configure it standard tag 'dependencies' inside tag 'plugin' could be used)
  • removed redundant public modifiers at interface nested classes (public by default)

What do you think?

- multiple messages.xml are read and merged
- Java SPI mechanism for discovering 3-rd party detectors
- default detector package is still needs to be used
- huntbugs maven plugin is not affected (to configure it standard tag 'dependencies' inside tag 'plugin' could be used)
- removed redundant public modifiers at interface nested classes (public by default)
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 85.975% when pulling 7ccfea0 on volkovs:custom-detectors into 7d50540 on amaembo:master.

@amaembo
Copy link
Owner

amaembo commented Aug 23, 2016

Adding third-party detectors is definitely planned. I will review your PR and possibly accept it (or modify somehow). But beware that at current development stage I cannot guarantee the API stability. It's possible that after updating to the new HuntBugs version you will have to add some changes to your detectors.

@volkovs
Copy link
Contributor Author

volkovs commented Aug 23, 2016

Sure, we understand the risk.

volkovs added a commit to volkovs/huntbugs that referenced this pull request Sep 10, 2016
 - sample project for custom detectors
 - detectors are automatically tested with sample code in test scope
 - sample project with HuntBugs maven plugin with custom detectors
 - production code in sample project is not annotated with @AssertWarning
 - sample project might be used for demonstration of project configuration without custom detectors as well
@volkovs volkovs mentioned this pull request Sep 10, 2016
@amaembo
Copy link
Owner

amaembo commented Sep 12, 2016

Closed as superceded by #20.

@amaembo amaembo closed this Sep 12, 2016
volkovs added a commit to volkovs/huntbugs that referenced this pull request Sep 13, 2016
 - introducing helper class to test detectors (to be reused)
 - custom detectors can be located in custom packages
 - minor refactoring
volkovs added a commit to volkovs/huntbugs that referenced this pull request Sep 13, 2016
 - plugin currently supports single detectors package for simplicity
 - introducing helper class to test detectors (to be reused)
 - custom detectors can be located in custom packages
 - minor refactoring
 - added license agreement headers
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants