LoginSignup
0
0

IntelliJで非ASCII文字(Non-ASCII characters)とメソッド名の小文字開始制限(should start with a lowercase letter)のワーニングを抑制する

Last updated at Posted at 2023-05-19

テストメソッド名に日本語を使う人も、それなりにいるんじゃないかと思いますが(私がそうなんですが)IntelliJで緩い警告が出るのがちょっと気になります。

image.png

これの抑制方法です。
ファイルの頭にこれをおいておくと消えます。

@file:Suppress("TestFunctionName", "NonAsciiCharacters")

image.png

これでスッキリ。

data classの場合(ついで)

data class Record(
  val AVG: Double,
  val HR: Int,
)

小文字で始めたまえと怒られるが、略語とか大文字で書きたいケースもあるよねということで。

@file:Suppress("PropertyName", "NonAsciiCharacters")

こいつを追加。

@file:Suppress("PropertyName", "NonAsciiCharacters")

data class Record(
  val AVG: Double,
  val HR: Int,
)

こんな感じ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0