Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit 6829f56

Browse files
committed
Add a predefined constant for non exhaustive match pattern
1 parent 0e6b5b1 commit 6829f56

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ name := "clippy"
2121
// factor out common settings into a sequence
2222
lazy val commonSettingsNoScalaVersion = Seq(
2323
organization := "com.softwaremill.clippy",
24-
version := "0.6.0",
24+
version := "0.6.1",
2525
scalacOptions ++= Seq("-unchecked", "-deprecation"),
2626
parallelExecution := false,
2727
// Sonatype OSS deployment

plugin-sbt/src/main/scala/com/softwaremill/clippy/ClippySbtPlugin.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ object ClippySbtPlugin extends AutoPlugin {
2626
val None = Value("none")
2727
}
2828

29+
object WarningPatterns {
30+
val NonExhaustiveMatch = "match may not be exhaustive[\\s\\S]*"
31+
}
32+
2933
object autoImport {
3034
val clippyColorsEnabled = settingKey[Boolean]("Should Clippy color type mismatch diffs and highlight syntax")
3135
val clippyColorDiff = settingKey[Option[ClippyColor.Value]]("The color to use for diffs, if other than default")
@@ -45,6 +49,7 @@ object ClippySbtPlugin extends AutoPlugin {
4549
settingKey[Option[String]]("Project root in which project-specific advice is stored, if any")
4650
val clippyFatalWarnings =
4751
settingKey[List[String]]("Regular expressions of warning messages which should fail compilation")
52+
val NonExhaustiveMatch = "match may not be exhaustive[\\s\\S]*"
4853
}
4954

5055
// in ~/.sbt auto import doesn't work, so providing aliases here for convenience

ui/app/views/use.scala.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h2>Adding the plugin</h2>
2929
</p>
3030

3131
<pre>
32-
addSbtPlugin("com.softwaremill.clippy" % "plugin-sbt" % "0.6.0")
32+
addSbtPlugin("com.softwaremill.clippy" % "plugin-sbt" % "0.6.1")
3333
</pre>
3434

3535
<p>
@@ -58,9 +58,11 @@ <h2>(NEW!) Turning selected compilation warnings into errors</h2>
5858
use the <code>clippyFatalWarnings</code> setting, for example:
5959
</p>
6060
<pre>
61+
import com.softwaremill.clippy.ClippySbtPlugin.WarningPatterns._
62+
// ...
6163
settings(
6264
clippyFatalWarnings ++= List(
63-
"match may not be exhaustive[\\s\\S]*",
65+
NonExhaustiveMatch,
6466
".*\\[wartremover:.*\\].*[\\s\\S]*"
6567
)
6668
)
@@ -175,15 +177,15 @@ <h2>Alternative ways to use Clippy</h2>
175177
</p>
176178

177179
<pre>
178-
addCompilerPlugin("com.softwaremill.clippy" %% "plugin" % "0.6.0" classifier "bundle")
180+
addCompilerPlugin("com.softwaremill.clippy" %% "plugin" % "0.6.1" classifier "bundle")
179181
</pre>
180182

181183
<p>
182184
If you are using <code>scalac</code> directly, add the following option:
183185
</p>
184186

185187
<pre>
186-
-Xplugin:clippy-plugin_2.11-0.6.0-bundle.jar
188+
-Xplugin:clippy-plugin_2.11-0.6.1-bundle.jar
187189
</pre>
188190

189191
<p>

0 commit comments

Comments
 (0)