Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 69afcf2

Browse files
author
exoego
committed
Disable -Wunused:privates to allow private constructor.
Also enable more lint options for quality.
1 parent 37516f9 commit 69afcf2

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

app/current/src/main/scala/io/scalajs/nodejs/dgram/Socket.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import scala.scalajs.js.annotation.JSImport
1616
*/
1717
@js.native
1818
@JSImport("dgram", "Socket")
19-
class Socket extends IEventEmitter {
19+
class Socket private[this] () extends IEventEmitter {
2020

2121
/**
2222
* Tells the kernel to join a multicast group at the given multicastAddress and multicastInterface using the

core/src/main/scala/io/scalajs/util/PromiseHelper.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ object PromiseHelper {
261261
case Success(_) =>
262262
val elapsedTime = System.currentTimeMillis - startTime
263263
println(f"$action took $elapsedTime msecs")
264-
case Failure(e) =>
264+
case Failure(_) =>
265265
val elapsedTime = System.currentTimeMillis - startTime
266266
println(f"$action took $elapsedTime msecs")
267267
}

project/MySettings.scala

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,46 @@ import sbtrelease.ReleaseStateTransformations._
66

77
object MySettings {
88

9+
private val lintSettings = Def.setting({
10+
val isScala212 = scalaVersion.value.startsWith("2.12")
11+
val lints = (Seq(
12+
"adapted-args",
13+
"nullary-unit",
14+
"inaccessible",
15+
"nullary-override",
16+
"infer-any",
17+
"missing-interpolator",
18+
"doc-detached",
19+
"private-shadow",
20+
"type-parameter-shadow",
21+
"poly-implicit-overload",
22+
"option-implicit",
23+
"delayedinit-select",
24+
"package-object-classes",
25+
"stars-align",
26+
"constant"
27+
) ++ Seq(
28+
"nonlocal-return",
29+
"implicit-not-found",
30+
"serial",
31+
"valpattern",
32+
"eta-zero",
33+
"eta-sam",
34+
"deprecation"
35+
).filter(_ => !isScala212)).map(s => s"-Xlint:${s}")
36+
// no privates to allow private constructor
37+
val unused = Seq("imports", "implicits", "locals", "patvars").filter(_ => !isScala212).map(s => s"-Wunused:${s}")
38+
lints ++ unused
39+
})
40+
941
lazy val commonSettings = Seq(
1042
autoCompilerPlugins := true,
1143
scalacOptions ++= Seq(
1244
"-deprecation",
1345
"-unchecked",
1446
"-feature",
15-
"-language:implicitConversions",
16-
"-Xlint"
17-
),
47+
"-language:implicitConversions"
48+
) ++ lintSettings.value,
1849
scalacOptions in Compile in compile ++= Seq(
1950
"-Xfatal-warnings"
2051
),

0 commit comments

Comments
 (0)