findbugs - 如何使用 Findbugs 避免 kotlin 文件

标签 findbugs kotlin

我正在将 findbugs 集成到一个混合的 java/kotlin 项目中。但是,由于 findbugs 作用于生成的 jar,它会查找与通过 kotlin 文件生成的类相关的错误。

有什么办法可以避免检查这些类吗?

谢谢

最佳答案

基于 <Source> 的过滤器过滤器类型。

This element matches warnings associated with a particular source file. The name attribute is used to specify the exact or regex match pattern for the source file name.

<FindBugsFilter>
    <Match>
        <Source name="~.*\.kt"/>
    </Match>
</FindBugsFilter>

见:documentation for FindBugs filtersname matching details

关于findbugs - 如何使用 Findbugs 避免 kotlin 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35461310/

相关文章:

java - 如何在 Kotlin 编写的接口(interface)中使用默认方法的 Java 8 功能

java - 如何修复直接写入 HTTP header 输出的 Findbugs HTTP 参数

android - 使用扩展方法的 Kotlin 数据绑定(bind)

kotlin - 不清楚sumBy block 中的参数如何工作(Kotlin)

java - FindBugs 警告 : Inefficient use of keySet iterator

android - 协程中的自定义拦截器

gradle - Kotlin 和 Gradle - 从 stdio 读取

maven - fb-contrib 错误显示为未知错误模式

java - findbugs可以检测未使用的公共(public)方法吗

java - 依赖默认编码,我应该使用什么以及为什么?