Skip to content

Commit

Permalink
Scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
t1b00 committed Aug 26, 2024
1 parent d688a50 commit 152329b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions input/src/main/scala/fix/NullParameter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ object NullParameter {
def normal(a: String) = {}
normal("test") // scalafix: ok;


abstract class Super(val name: String)
case class Boo(override val name: String) extends Super(name) // scalafix: ok;
class Birds(names:String*) // scalafix: ok;
class Birds(names: String*) // scalafix: ok;

}
6 changes: 3 additions & 3 deletions rules/src/main/scala/fix/NullParameter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class NullParameter extends SemanticRule("NullParameter") {
override def fix(implicit doc: SemanticDocument): Patch = {
doc.tree.collect {
case Term.ArgClause(values, _) => values.collect {
case Lit.Null() => Patch.lint(diag(values.head.pos))
case _ => Patch.empty
}
case Lit.Null() => Patch.lint(diag(values.head.pos))
case _ => Patch.empty
}
}.flatten.asPatch
}
}
4 changes: 2 additions & 2 deletions rules/src/main/scala/fix/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ object Util {
def getType(term: Stat)(implicit doc: SemanticDocument): Symbol = {
term.symbol.info match {
case Some(symInfo) => symInfo.signature match {
case ValueSignature(TypeRef(_, symbol, _)) => symbol
case ValueSignature(TypeRef(_, symbol, _)) => symbol
case MethodSignature(_, _, TypeRef(_, symbol, _)) => symbol
case _ => Symbol.None
case _ => Symbol.None
}
case _ => Symbol.None
}
Expand Down

0 comments on commit 152329b

Please sign in to comment.