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

How to generate Baseline file? #1230

Open
scscgit opened this issue Aug 14, 2024 · 0 comments
Open

How to generate Baseline file? #1230

scscgit opened this issue Aug 14, 2024 · 0 comments

Comments

@scscgit
Copy link

scscgit commented Aug 14, 2024

I wasn't able to find any documentation with steps how to generate the baseline file, which we define under

spotbugs {
    baselineFile = file("spotbugs-baseline.xml")
}

There are two issues about using it, but nothing about how it's generated.

When I copy all <BugInstance> elements inside

<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter
        xmlns="https://github.com/spotbugs/filter/4.8.4"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="https://github.com/spotbugs/filter/4.8.4 https://raw.githubusercontent.com/spotbugs/spotbugs/4.8.4/spotbugs/etc/findbugsfilter.xsd">
</FindBugsFilter>

(which by the way I'd like to turn into local paths for schema resolution against Gradle dependency)

I'm still getting the following error:

The following errors occurred during analysis:
  Unable to read filter: C:\Project\spotbugs-baseline.xml : Failing reading C:\Project\spotbugs-baseline.xml
    org.dom4j.DocumentException: Failing reading C:\Project\spotbugs-baseline.xml
      At edu.umd.cs.findbugs.SortedBugCollection.readXML(SortedBugCollection.java:279)

I'm not even sure if it should have syntax from https://spotbugs.readthedocs.io/en/stable/filter.html

I was thinking if the SpotBugs IntelliJ IDEA Plugin could support creating baseline similar to FindBugs mentioned by https://stackoverflow.com/a/48072089, but the plugin is broken, so I can't even try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant