-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add sbt-tpolecat to tests * Fix warnings in tests * Fix warnings in tests * Fix scalacOptions * Increase sbt max memory * Remove kind projector * Update to Scala 2.13.10 * Disable non-unit statement warning in tests * Fix non-unit statements in @react macro * Add Scala 3 scalafix config * Run scalafix * Fix style * Fix discarded non-unit statements in @react macro * Move annotated components back to the tests * Disable fatal warnings for Scala 3 build
- Loading branch information
Showing
20 changed files
with
158 additions
and
76 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,2 @@ | ||
-J-Xmx2048M | ||
-J-XX:+UseG1GC |
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,27 @@ | ||
# This has to be maintained separately as Scala 3 does not currently support the rules: | ||
# - RemoveUnused (https://github.com/scalacenter/scalafix/issues/1682). | ||
# - ProcedureSyntax. | ||
# See https://github.com/scalacenter/scalafix/issues/1747. | ||
rules = [ | ||
DisableSyntax | ||
LeakingImplicitClassVal | ||
NoValInForComprehension | ||
] | ||
|
||
DisableSyntax.noVars = false | ||
DisableSyntax.noThrows = false | ||
DisableSyntax.noNulls = false | ||
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" | ||
} | ||
] |
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
1 change: 0 additions & 1 deletion
1
core/src/main/scala-2/slinky/core/FunctionalComponentName.scala
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
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
# Remove semanticdbVersion from build.sbt when this is updated. | ||
sbt.version=1.7.3 |
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
1 change: 0 additions & 1 deletion
1
readWrite/src/main/scala-2/slinky/readwrite/CoreReadersMacro.scala
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
1 change: 0 additions & 1 deletion
1
readWrite/src/main/scala-2/slinky/readwrite/CoreWritersMacro.scala
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 |
---|---|---|
@@ -1,24 +1,54 @@ | ||
import _root_.io.github.davidgregory084._ | ||
|
||
enablePlugins(ScalaJSPlugin) | ||
enablePlugins(JSDependenciesPlugin) | ||
|
||
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.9" % Test | ||
libraryDependencies += ("org.scala-js" %%% "scalajs-fake-insecure-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13) | ||
libraryDependencies += ("org.scala-js" %%% "scalajs-fake-insecure-java-securerandom" % "1.0.0") | ||
.cross(CrossVersion.for3Use2_13) | ||
|
||
Test / jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv() | ||
|
||
Test / scalaJSLinkerConfig ~= { _.withESFeatures(_.withUseECMAScript2015( | ||
Option(System.getenv("ES2015_ENABLED")).map(_ == "true").getOrElse(false) | ||
)) } | ||
Test / scalaJSLinkerConfig ~= { | ||
_.withESFeatures( | ||
_.withUseECMAScript2015( | ||
Option(System.getenv("ES2015_ENABLED")).map(_ == "true").getOrElse(false) | ||
) | ||
) | ||
} | ||
|
||
Test / unmanagedResourceDirectories += baseDirectory.value / "node_modules" | ||
|
||
jsDependencies ++= Seq( | ||
(ProvidedJS / "react/umd/react.development.js" | ||
minified "react/umd/react.production.min.js" commonJSName "React") % Test, | ||
(ProvidedJS / "react-dom/umd/react-dom.development.js" | ||
minified "react-dom/umd/react-dom.production.min.js" dependsOn "react/umd/react.development.js" commonJSName "ReactDOM") % Test, | ||
(ProvidedJS / "react-dom/umd/react-dom-test-utils.development.js" | ||
minified "react-dom/umd/react-dom-test-utils.production.min.js" dependsOn "react-dom/umd/react-dom.development.js" commonJSName "ReactTestUtils") % Test, | ||
(ProvidedJS / "react-dom/umd/react-dom-server.browser.development.js" | ||
minified "react-dom/umd/react-dom-server.browser.production.min.js" dependsOn "react-dom/umd/react-dom.development.js" commonJSName "ReactDOMServer") % Test | ||
((ProvidedJS / "react/umd/react.development.js") | ||
.minified("react/umd/react.production.min.js") | ||
.commonJSName("React")) % Test, | ||
((ProvidedJS / "react-dom/umd/react-dom.development.js") | ||
.minified("react-dom/umd/react-dom.production.min.js") | ||
.dependsOn("react/umd/react.development.js") | ||
.commonJSName("ReactDOM")) % Test, | ||
((ProvidedJS / "react-dom/umd/react-dom-test-utils.development.js") | ||
.minified("react-dom/umd/react-dom-test-utils.production.min.js") | ||
.dependsOn("react-dom/umd/react-dom.development.js") | ||
.commonJSName("ReactTestUtils")) % Test, | ||
((ProvidedJS / "react-dom/umd/react-dom-server.browser.development.js") | ||
.minified("react-dom/umd/react-dom-server.browser.production.min.js") | ||
.dependsOn("react-dom/umd/react-dom.development.js") | ||
.commonJSName("ReactDOMServer")) % Test | ||
) | ||
|
||
// The Scala 3 tests still have a bunch of warnings that need fixing such as https://github.com/shadaj/slinky/issues/643 | ||
// before CiMode can be used. | ||
tpolecatOptionsMode := (CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((3, _)) => DevMode | ||
case _ => CiMode | ||
}) | ||
|
||
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, _)) => Seq("-P:scalajs:nowarnGlobalExecutionContext") | ||
case _ => Seq.empty | ||
}) | ||
|
||
// Unit statements are prevalent in the tests. There is no way to suppress them: | ||
// See https://github.com/typelevel/sbt-tpolecat/issues/134. | ||
Test / tpolecatExcludeOptions += ScalacOptions.warnNonUnitStatement |
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
Oops, something went wrong.