如何禁止有关命名约定的警告?

问题描述 投票:0回答:1

对于我的一个枚举类,我想使用非标准命名:

enum class MyEnum {
    I_like_to_use,
    This_strange_naming_here
}

IDE(和代码检查)正确地抱怨:

Enum entry name 'This_strange_naming_here' doesn't match regex '[A-Z]([A-Za-z\d]*|[A-Z_\d]*)'.
This inspection reports enum entry named that do not follow the recommended naming conventions.

但是在这种情况下,我想积极地压制这个警告。我尝试使用@Suppress("naming"),但无济于事。

intellij-idea kotlin
1个回答
1
投票

请参阅Suppress inspections。你不应该手工打字。

Suppress

© www.soinside.com 2019 - 2024. All rights reserved.