Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要抑制两个错误:WildcardImport 和 MatchingDeclarationName。问题是它需要应用于整个文件,有没有办法做到这一点?
如果你想抑制一个类的 detekt,你可以把它放在你的类声明的顶部
@Suppress("WildcardImport","MatchingDeclarationName") class SampleClass
或者如果你想抑制整个文件,你可以把这个注释
@file:Suppress("WildcardImport","MatchingDeclarationName")