From 57e847e1497157b53933ac9ed3cef7c44a9fb3df Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Fri, 17 Jan 2025 12:43:04 +0900 Subject: [PATCH] Update UnmooredDocComment.scala --- rules/src/main/scala/fix/UnmooredDocComment.scala | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/rules/src/main/scala/fix/UnmooredDocComment.scala b/rules/src/main/scala/fix/UnmooredDocComment.scala index 677fa02..cc57ef6 100644 --- a/rules/src/main/scala/fix/UnmooredDocComment.scala +++ b/rules/src/main/scala/fix/UnmooredDocComment.scala @@ -45,7 +45,7 @@ class UnmooredDocComment extends SyntacticRule("UnmooredDocComment") { Patch.lint( Diagnostic( id = "", - message = s"unmoored doc comment for `${treeName(tree)}`", + message = s"unmoored doc comment for `${tree.productPrefix}`", position = comment.pos, severity = LintSeverity.Warning ) @@ -53,13 +53,4 @@ class UnmooredDocComment extends SyntacticRule("UnmooredDocComment") { } .asPatch } - - private def treeName(t: Tree): String = { - t match { - case x: scala.Product => - x.productPrefix - case _ => - t.getClass.getName - } - } }