How can I integrate those options? Do I add it to my build.sbt ?
Yes, you set them manually as the blog post shows or, you can just use sbt-tpolecat and call it a day.
This is great because:
The plugin is updated, whereas the blog post isn’t.
The plugin automatically handles cross-compilation.
If you use something like scala stedward you will have the plugin always updated.
Does anyone know how to enforce them in IntelliJ?
No idea, sorry. I do not use IntelliJ.
I believe that if you import the build IntelliJ should identify and respect them, but not sure.
I just use metals + vscdoe which does import all those options.
BTW: Even if the plugin will configure all the flags for you, I still recommend you to read the blog and understand all the flags.
-Xfatal-warnings and -Werror are the same, -W is new for everything warnings in 2.13, but the old flags continue to work.
-Wconf:any:error changes every warning to be an error, which causes the compiler to stop after the phase where the first warning occurs.
-Werror issues warnings as warnings and runs the compilation pipeline to the end, including the generation of classfiles. It issues a single error message at the end and quits with a non-zero exit code.
Interestingly, zinc special-cases -Werror and issues every warning as an individual error. So in sbt, -Werror behaves like -Wconf:any:error.