@@ -29,7 +29,7 @@ <h2>Adding the plugin</h2>
2929</ p >
3030
3131< pre >
32- addSbtPlugin("com.softwaremill.clippy" % "plugin-sbt" % "0.5.3 ")
32+ addSbtPlugin("com.softwaremill.clippy" % "plugin-sbt" % "0.6.0 ")
3333</ pre >
3434
3535< p >
@@ -52,6 +52,23 @@ <h2>Adding the plugin</h2>
5252 as < code > scalacOptions += "-P:clippy:colors=true"</ code > )</ li >
5353</ ul >
5454
55+ < h2 > (NEW!) Turning selected compilation warnings into errors</ h2 >
56+ < p >
57+ From version 0.6.0 you can selectively define regexes for warnings which will be treated as fatal compilation errors. To do so with sbt,
58+ use the < code > clippyFatalWarnings</ code > setting, for example:
59+ </ p >
60+ < pre >
61+ settings(
62+ clippyFatalWarnings ++= Seq(
63+ "match may not be exhaustive[\\s\\S]*",
64+ ".*\\[wartremover:.*\\].*[\\s\\S]*"
65+ )
66+ )
67+ </ pre >
68+ < p >
69+ You can also define fatal warnings in your .clippy.json file (see further sections for examples).
70+ </ p >
71+
5572< h2 > Enabling syntax and type mismatch diffs highlighting</ h2 >
5673
5774< p >
@@ -107,9 +124,9 @@ <h2>Contributing advice</h2>
107124 < a href ="https://github.com/softwaremill/scala-clippy "> source code</ a > .
108125</ p >
109126
110- < h2 > Project-specific advices</ h2 >
127+ < h2 > Project-specific advices and fatal warnings </ h2 >
111128
112- < p > If you have advice that you feel is too specific to be worth sharing publicly, you can add
129+ < p > If you have advice that you feel is too specific to be worth sharing publicly, you can add
113130 it to your project specific advice file. First set your project root:
114131</ p >
115132< pre >
@@ -120,6 +137,7 @@ <h2>Project-specific advices</h2>
120137
121138< pre >
122139{
140+ "version": "1",
123141 "advices": [
124142 {
125143 "error": {
@@ -134,6 +152,12 @@ <h2>Project-specific advices</h2>
134152 "version": "1.0"
135153 }
136154 }
155+ ],
156+ "fatalWarnings": [
157+ {
158+ "pattern": "match may not be exhaustive[\\s\\S]*",
159+ "text": "Additional optional text to be displayed"
160+ }
137161 ]
138162}
139163</ pre >
@@ -151,15 +175,15 @@ <h2>Alternative ways to use Clippy</h2>
151175</ p >
152176
153177< pre >
154- addCompilerPlugin("com.softwaremill.clippy" %% "plugin" % "0.5.3 " classifier "bundle")
178+ addCompilerPlugin("com.softwaremill.clippy" %% "plugin" % "0.6.0 " classifier "bundle")
155179</ pre >
156180
157181< p >
158182 If you are using < code > scalac</ code > directly, add the following option:
159183</ p >
160184
161185< pre >
162- -Xplugin:clippy-plugin_2.11-0.5.3 -bundle.jar
186+ -Xplugin:clippy-plugin_2.11-0.6.0 -bundle.jar
163187</ pre >
164188
165189< p >
0 commit comments