sbt-tpolecat
sbt-tpolecat copied to clipboard
Is it possible to disable the unused warnings for generated src code in `target/src_manged`?
Not the same, but in Scala 2.13 you can suppress warnings in a directory:
Compile / scalacOptions += "-Wconf:src=target/.*:silent" // suppress all warnings for autogenerated files
@iRevive's suggestion is how I've seen most projects deal with this problem (see e.g. https://github.com/hmrc/transit-movements-guarantee-balance/blob/main/build.sbt#L45), but if your code generator uses a custom sbt configuration (i.e. not Compile or Test but e.g. Routes) you could potentially set options in that configuration instead.
I came to the repo specifically to find this info - maybe it should be added to the README?
Is there a similar option for Scala 3?
@hugo-vrijswijk The Compiler Options Lookup Table says that -Wconf is available in Scala 3.3.x, so it should be the same?
I think the syntax might be different, or it is unsupported:
[warn] Failed to parse `-Wconf` configuration: src=target/.*:silent
[warn] unknown filter: src
Unfortunately it looks like the src filter for -Wconf is not yet supported on Scala 3.x.
fyi src filter is supported in scala 3.3.4 and 3.5.0: https://github.com/scala/scala3/pull/18783