This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
BugPattern categories and plugin testing #111
Comments
I stumbled on this same issue when playing around with making a custom detector. As best I can tell, you can have a "custom" category defined in your plugin descriptor, and that works fine:
The problem comes if your custom detector tries to refer to any of the "built-in" categories other than Not sure why this is happening but it seems to be some interaction between the way the test harness
|
@matthewlowry : if this is a bug, feel free to provide a patch for it. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm writing a SpotBugs plugin, starting from the maven archetype as suggested in the documentation.
I wrote a detector and some test classes for it. Also, I migrated the test code to JUnit5, using
SpotBugsExtension
class from thetest-harness-jupiter
artifact. Everything worked as expected until I tried to change the category of the detected bug, by changing the value of thecategory
attribute of theBugPattern
tag for the bug type reported by my detector infindbugs.xml
.The bugs in the "bad case" classes are in fact detected in my tests if the category is the default
CORRECTNESS
, but not, for example, if I set it toBAD_PRACTICE
orSTYLE
.Is it possible to instruct the
SpotBugsRunner
which the JUnit extension injects in my test methods to also detect bugs of these categories?The text was updated successfully, but these errors were encountered: