xmlfindbugsspotbugs

FindBugs/SpotBugs: Filters: DTO or XML Schema


In short: Is there an official DTD or XML Schema for FindBugs/SpotBugs Filter Files?

In detail: In FindBugs/SpotBugs it is possible to define filter files which are XML files. My IDE is complaining about the missing DTD or XML Schema which is fine. I know how to suppress this warning but I prefer adding a proper grammar file. Therefore, is there a DTD or XML Schema provided by FindBugs/SpotBugs Filter Files? I couldn't find one.


Solution

  • Update due to findbugs project being continued as spotbugs:

    The current version of the xsd is located at https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd.

    And the valid namespace definition in the filter xml looks like this:

    <FindBugsFilter
              xmlns="https://github.com/spotbugs/filter/3.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
    

    Source: https://spotbugs.readthedocs.io/en/stable/filter.html#complete-example