-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Can't generate HTML reports after upgrade to 4.8.0 #629
Comments
+1 and I am using Gradle 7.3 although function test seems to be passing: https://github.com/spotbugs/spotbugs-gradle-plugin/blob/4.8.0/src/functionalTest/groovy/com/github/spotbugs/snom/ReportFunctionalTest.groovy#L255 |
Could you share a mcve project to reproduce it in my local? |
Holy crap this took way too long... https://github.com/leviem1/spotbugs-mcve If you can't reproduce, it's because you're on macOS or Linux, and it probably has to do with path separators being platform dependent. Nonetheless, unwanted XML files are present on both platforms and I'm able to reproduce no HTML files on my Windows box only. |
I could reproduce the reported issue at GitHub Action: |
Glad to hear you were able to reproduce. Seems like it's definitely platform dependent. I tried to do some bug hunting on my own, but didn't catch anything obvious at first glance.... The path separator comment was a shot in the dark and I haven't found anything to support it. This could easily be an issue in spotbugs core as well. I'll keep looking, but let me know if I need to open an issue in the core project. |
The generated command line options are LGTM. I will try to reproduce on the spotbugs core project side.
|
Confirmed that |
After spinning around 3 times, standing on my head, and making a prayer to the computer gods, I was able to find a config combo that produces the correct results: tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
reports {
xml {
enabled = false
}
html {
enabled = true
stylesheet = 'default.xsl'
}
}
} This leads me to believe that the error was introduced here: spotbugs/spotbugs@6882383#diff-4e11ecc7198156d84146e3ac10b8ce11e0884688746d40b003000c1074dc0468R277-R291 Maybe something to do with when Doesn't explain why it's not reproduceable on my macOS box though. Totally guessing again, but maybe something to do with closing/flushing streams? |
Aha, possible, Windows has a colon in file path after the drive letter, so current implementation probably have a problem around it. I'll try to write a unit test for reproduction. Thanks! |
Here is the point: It expects no |
Still have the same problem using Gradle 7.3.1 and SpotBugs plugin 5.0.0 under Windows:
|
@aburmeis the fix has been merged into the core project and should be available in a future release. It was not included in v5.0.0 based on the release notes. The workaround of explicitly denoting a stylesheet should work until the fix is released, though I haven't tested it super extensively. tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
reports {
xml {
enabled = false
}
html {
required.set(true)
stylesheet = 'default.xsl'
}
}
} Correct me if I'm wrong so I can avoid a breaking update. Edit: I agree that using |
I confirmed this problem in my local :< |
@aburmeis I just reproduced the issue with the file named "C" you mentioned with this config tasks.withType(SpotBugsTask) {
reports {
xml.required.set(false)
html.required.set(true)
}
} But for some reason, I don't get the issue with this syntax. tasks.withType(SpotBugsTask) {
reports {
xml {
required.set(false)
}
html {
required.set(true)
}
}
} @KengoTODA Maybe worth investigating or writing a test to check if spotbugs/spotbugs#1842 fixes this case as well? Unless I just don't understand a nuance of Groovy.
Edit 3: My bad, guess I had some cache issues |
🎉 This issue has been resolved in version 5.0.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
I'm no longer able to generate HTML reports on 4.8.0 with the following configuration that worked on 4.7.10. Only XML reports are available despite being explicitly disabled. There's also 2 violations detected despite only 1 being detected on 4.7.10.
The following configuration from #628 gave the same result:
This configuration from #628 resulted in no output files at all and only 1 detected violation.
Am I missing something?
The text was updated successfully, but these errors were encountered: