-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve formatting and code quality tools (#19)
- Loading branch information
Showing
7 changed files
with
105 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
rules = [ | ||
# Disable | ||
# NoInfer | ||
DisableSyntax # Reports an error for disabled features such as var or XML literals. | ||
# RemoveUnused | ||
LeakingImplicitClassVal # Adds 'private' to val parameters of implicit value classes | ||
NoValInForComprehension # Removes deprecated val inside for-comprehension binders | ||
# ProcedureSyntax # Replaces deprecated procedure syntax with explicit ': Unit =' | ||
NoAutoTupling | ||
# RewriteDeprecatedNames # Scalatest 3.1 migration | ||
|
||
# Mark case classes as final | ||
# https://nrinaudo.github.io/scala-best-practices/tricky_behaviours/final_case_classes.html | ||
# MissingFinal | ||
] | ||
|
||
# https://nrinaudo.github.io/scala-best-practices/unsafe/ | ||
DisableSyntax { | ||
noXml = true | ||
noVars = true | ||
noNulls = true | ||
noReturns = true | ||
noFinalize = true | ||
noWhileLoops = true | ||
noAsInstanceOf = true | ||
noIsInstanceOf = true | ||
|
||
# motivation https://github.com/sbt/zinc/issues/227 | ||
noFinalVal = true | ||
|
||
noValPatterns = false | ||
noUniversalEquality = false | ||
noSemicolons = true | ||
noImplicitObject = true | ||
|
||
# https://nrinaudo.github.io/scala-best-practices/oop/abstract_fields_as_defs.html | ||
# https://docs.scala-lang.org/tutorials/FAQ/initialization-order.html | ||
noValInAbstract = true | ||
} | ||
|
||
Disable.symbols = [ | ||
# https://nrinaudo.github.io/scala-best-practices/adts/enumerations_as_adt.html | ||
"scala.Enumeration" | ||
|
||
# https://nrinaudo.github.io/scala-best-practices/partial_functions/ | ||
|
||
"scala.util.Either.LeftProjection.get" | ||
"scala.util.Either.RightProjection.get" | ||
|
||
# Wartremover.OptionPartial | ||
"scala.Option.get" | ||
"scala.Some.get" | ||
"scala.None.get" | ||
|
||
# Wartremover.TryPartial | ||
"scala.util.Try.get" | ||
"scala.util.Failure.get" | ||
"scala.util.Success.get" | ||
] | ||
|
||
Disable.ifSynthetic = [ | ||
"scala.Predef.any2stringadd" | ||
"scala.Any" | ||
"scala.AnyVal" | ||
] | ||
|
||
NoInfer.disabledTypes = [ | ||
"scala.Any" | ||
"scala.AnyVal" | ||
"java.io.Serializable" | ||
"scala.Serializable" | ||
"scala.Product" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters