Skip to content

Commit

Permalink
added scalafix and scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
oen9 committed Apr 28, 2020
1 parent 665298a commit 5d930d5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
rules = [
RemoveUnused
DisableSyntax
LeakingImplicitClassVal
NoValInForComprehension
ProcedureSyntax
]

DisableSyntax.noVars = true
DisableSyntax.noThrows = true
DisableSyntax.noNulls = true
DisableSyntax.noReturns = true
DisableSyntax.noAsInstanceOf = false
DisableSyntax.noIsInstanceOf = true
DisableSyntax.noXml = true
DisableSyntax.noFinalVal = true
DisableSyntax.noFinalize = true
DisableSyntax.noValPatterns = true
DisableSyntax.regex = [
{
id = noJodaTime
pattern = "org\\.joda\\.time"
message = "Use java.time instead"
}
]
10 changes: 10 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version = 2.4.2
project.git = true
maxColumn = 120
align = more
assumeStandardLibraryStripMargin = true
rewrite.rules = [AvoidInfix, SortImports, RedundantBraces, RedundantParens, SortModifiers]
rewrite.redundantBraces.stringInterpolation = true
spaces.afterTripleEquals = true
continuationIndent.defnSite = 2
includeCurlyBraceInSelectChains = false
7 changes: 5 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ lazy val sharedSettings = Seq(
"-deprecation",
"-feature",
"-language:higherKinds",
"-Ymacro-annotations"
)
"-Ymacro-annotations",
"-Ywarn-unused:imports",
),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
)

lazy val jsSettings = Seq(
Expand Down
1 change: 1 addition & 0 deletions js/src/main/scala/example/modules/Chat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import slinky.web.html._
val (errors, setErrors) = useState(Vector[String]())
val (msgs, setMsgs) = useState(Vector[String]())
val (autoscroll, setAutoscroll) = useState(true)

val chatRef = React.createRef[html.Div]

def handleUsername(e: SyntheticEvent[html.Input, Event]): Unit = setUsername(e.target.value)
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.17.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.0")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.15")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4")

0 comments on commit 5d930d5

Please sign in to comment.