1

简而言之:FindBugs/SpotBugs 过滤文件有官方的 DTD 或 XML 模式吗?

详细说明:在 FindBugs/SpotBugs 中,可以定义 XML 文件的过滤器文件。我的 IDE 抱怨缺少 DTD 或 XML Schema,这很好。我知道如何抑制此警告,但我更喜欢添加正确的语法文件。因此,是否有 FindBugs/SpotBugs Filter Files 提供的 DTD 或 XML Schema?我找不到一个。

4

2 回答 2

6

由于 findbugs 项目作为 spotbugs 继续更新:

当前版本的 xsd 位于https://raw.githubusercontent.com/spotbugs/spotbugs/release-3.1/spotbugs/etc/findbugsfilter.xsd

过滤器 xml 中的有效命名空间定义如下所示:

<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/release-3.1/spotbugs/etc/findbugsfilter.xsd">
于 2018-03-12T12:39:02.173 回答
4

更新:请参阅@dpr 的答案。SpotBugs XSD 应该用于现代项目:https ://raw.githubusercontent.com/spotbugs/spotbugs/release-3.1/spotbugs/etc/findbugsfilter.xsd 。

您可以在 GitHub 项目上找到 XSD 文件 (findbugsfilter.xsd)以验证您的过滤器配置。

如果您的 IDE 需要绝对 URL,您可以使用以下内容: https ://raw.githubusercontent.com/findbugsproject/findbugs/master/findbugs/etc/findbugsfilter.xsd

于 2016-08-24T21:11:49.143 回答