Search code examples
kotlindetekt

How to suppress WildcardImport and MatchingDeclarationName for Detekt?


I need to suppress two errors: WildcardImport and MatchingDeclarationName. Probleme is that it is need to be applied to the whole file, is there any way to do this?


Solution

  • If you want to suppress detekt on a class you can put this on the top of your class declaration

    @Suppress("WildcardImport","MatchingDeclarationName")
    class SampleClass
    

    Or if you want to suppress the whole file you can put this annotation

    @file:Suppress("WildcardImport","MatchingDeclarationName")