diff --git a/rules/src/main/scala/fix/DirectoryAndPackageName.scala b/rules/src/main/scala/fix/DirectoryAndPackageName.scala index 6a2a76a..f2f710f 100644 --- a/rules/src/main/scala/fix/DirectoryAndPackageName.scala +++ b/rules/src/main/scala/fix/DirectoryAndPackageName.scala @@ -155,7 +155,7 @@ class DirectoryAndPackageName(config: DirectoryAndPackageNameConfig) extends Syn dirOpt = config.baseDirectory.find { dir => path.contains(dir) }.map { dir => - path.split(dir).last.split('/').init.mkString("/") + path.split(dir).last.split('/').init.toList } dir <- dirOpt if packages.nonEmpty // TODO check if empty package @@ -166,10 +166,9 @@ class DirectoryAndPackageName(config: DirectoryAndPackageNameConfig) extends Syn if (keywords(p)) { p.replace("`", "") } else p ) - .mkString("/") packageObjectOpt match { case Some(value) => - x + "/" + value.name.value + x :+ value.name.value case None => x } @@ -179,7 +178,7 @@ class DirectoryAndPackageName(config: DirectoryAndPackageNameConfig) extends Syn Patch.lint( Diagnostic( id = "", - message = s"inconsistent package and directory\n${path}\n${packageName}", + message = s"inconsistent package and directory\n${path}\n${packageName.mkString("/")}", position = packages.last.pos, severity = config.severity )