@@ -111,6 +111,53 @@ trait CommonScalaSettings:
111
111
val help : Setting [Boolean ] = BooleanSetting (" -help" , " Print a synopsis of standard options." , aliases = List (" --help" , " -h" ))
112
112
val pageWidth : Setting [Int ] = IntSetting (" -pagewidth" , " Set page width" , ScalaSettings .defaultPageWidth, aliases = List (" --page-width" ))
113
113
val silentWarnings : Setting [Boolean ] = BooleanSetting (" -nowarn" , " Silence all warnings." , aliases = List (" --no-warnings" ))
114
+ val XfatalWarnings : Setting [Boolean ] = BooleanSetting (" -Werror" , " Fail the compilation if there are any warnings." , aliases = List (" -Xfatal-warnings" ))
115
+ val Wconf : Setting [List [String ]] = MultiStringSetting (
116
+ " -Wconf" ,
117
+ " patterns" ,
118
+ default = List (),
119
+ descr =
120
+ s """ Configure compiler warnings.
121
+ |Syntax: -Wconf:<filters>:<action>,<filters>:<action>,...
122
+ |multiple <filters> are combined with &, i.e., <filter>&...&<filter>
123
+ |
124
+ |<filter>
125
+ | - Any message: any
126
+ |
127
+ | - Message categories: cat=deprecation, cat=feature, cat=unchecked
128
+ |
129
+ | - Message content: msg=regex
130
+ | The regex need only match some part of the message, not all of it.
131
+ |
132
+ | - Message id: id=E129
133
+ | The message id is printed with the warning.
134
+ |
135
+ | - Message name: name=PureExpressionInStatementPosition
136
+ | The message name is printed with the warning in verbose warning mode.
137
+ |
138
+ |In verbose warning mode the compiler prints matching filters for warnings.
139
+ |Verbose mode can be enabled globally using `-Wconf:any:verbose`, or locally
140
+ |using the @nowarn annotation (example: `@nowarn("v") def test = try 1`).
141
+ |
142
+ |<action>
143
+ | - error / e
144
+ | - warning / w
145
+ | - verbose / v (emit warning, show additional help for writing `-Wconf` filters)
146
+ | - info / i (infos are not counted as warnings and not affected by `-Werror`)
147
+ | - silent / s
148
+ |
149
+ |The default configuration is empty.
150
+ |
151
+ |User-defined configurations are added to the left. The leftmost rule matching
152
+ |a warning message defines the action.
153
+ |
154
+ |Examples:
155
+ | - change every warning into an error: -Wconf:any:error
156
+ | - silence deprecations: -Wconf:cat=deprecation:s
157
+ |
158
+ |Note: on the command-line you might need to quote configurations containing `*` or `&`
159
+ |to prevent the shell from expanding patterns. """ .stripMargin,
160
+ )
114
161
115
162
val javaOutputVersion : Setting [String ] = ChoiceSetting (" -java-output-version" , " version" , " Compile code with classes specific to the given version of the Java platform available on the classpath and emit bytecode for this version. Corresponds to -release flag in javac." , ScalaSettings .supportedReleaseVersions, " " , aliases = List (" -release" , " --release" ))
116
163
@@ -162,7 +209,6 @@ private sealed trait WarningSettings:
162
209
self : SettingGroup =>
163
210
164
211
val Whelp : Setting [Boolean ] = BooleanSetting (" -W" , " Print a synopsis of warning options." )
165
- val XfatalWarnings : Setting [Boolean ] = BooleanSetting (" -Werror" , " Fail the compilation if there are any warnings." , aliases = List (" -Xfatal-warnings" ))
166
212
val WvalueDiscard : Setting [Boolean ] = BooleanSetting (" -Wvalue-discard" , " Warn when non-Unit expression results are unused." )
167
213
val WNonUnitStatement = BooleanSetting (" -Wnonunit-statement" , " Warn when block statements are non-Unit expressions." )
168
214
val WimplausiblePatterns = BooleanSetting (" -Wimplausible-patterns" , " Warn if comparison with a pattern value looks like it might always fail." )
@@ -225,53 +271,6 @@ private sealed trait WarningSettings:
225
271
def strictNoImplicitWarn (using Context ) =
226
272
isChoiceSet(" strict-no-implicit-warn" )
227
273
228
- val Wconf : Setting [List [String ]] = MultiStringSetting (
229
- " -Wconf" ,
230
- " patterns" ,
231
- default = List (),
232
- descr =
233
- s """ Configure compiler warnings.
234
- |Syntax: -Wconf:<filters>:<action>,<filters>:<action>,...
235
- |multiple <filters> are combined with &, i.e., <filter>&...&<filter>
236
- |
237
- |<filter>
238
- | - Any message: any
239
- |
240
- | - Message categories: cat=deprecation, cat=feature, cat=unchecked
241
- |
242
- | - Message content: msg=regex
243
- | The regex need only match some part of the message, not all of it.
244
- |
245
- | - Message id: id=E129
246
- | The message id is printed with the warning.
247
- |
248
- | - Message name: name=PureExpressionInStatementPosition
249
- | The message name is printed with the warning in verbose warning mode.
250
- |
251
- |In verbose warning mode the compiler prints matching filters for warnings.
252
- |Verbose mode can be enabled globally using `-Wconf:any:verbose`, or locally
253
- |using the @nowarn annotation (example: `@nowarn("v") def test = try 1`).
254
- |
255
- |<action>
256
- | - error / e
257
- | - warning / w
258
- | - verbose / v (emit warning, show additional help for writing `-Wconf` filters)
259
- | - info / i (infos are not counted as warnings and not affected by `-Werror`)
260
- | - silent / s
261
- |
262
- |The default configuration is empty.
263
- |
264
- |User-defined configurations are added to the left. The leftmost rule matching
265
- |a warning message defines the action.
266
- |
267
- |Examples:
268
- | - change every warning into an error: -Wconf:any:error
269
- | - silence deprecations: -Wconf:cat=deprecation:s
270
- |
271
- |Note: on the command-line you might need to quote configurations containing `*` or `&`
272
- |to prevent the shell from expanding patterns. """ .stripMargin,
273
- )
274
-
275
274
/** -X "Extended" or "Advanced" settings */
276
275
private sealed trait XSettings :
277
276
self : SettingGroup =>
0 commit comments