I would propose to implement fine-granular warning settings.
So, for each kind of a warning we should be able choose one of 3 possible alert levels, {IGNORE | WARN | FAIL}.
The only problem is how to identify warnings - there is no identifier parameter available in compiler logging method (c.warning(...), etc).
Actually we may implement two solutions (both of them may co-exist):
Add a “identifier” parameter into compiler to all the compiler logging methods. So we may provide identifiers like c.warning(123456, "message"), c.error(4567, "message")
Add missing parameters with a macro as a hash(file:line:character).
At the end we would be able to do smth like scalac -Y:warning:SC-XXXX:ignore -Y:warning:SC-XXXX:fail
This should be relatively easy to implement and it should significantly improve our experience.
Besides customizing each warning type, we also need to be able to make those customizations within a particular scope. If it’s for an entire compiler invocation it could be a scalac flag but if it’s for a specific region of code there needs to be a way of specifying it in the code. The only thing I know of that has such a duality is language imports. I guess this would be another.
I’m not sure what c.error(...) is – is that code in the scalac codebase?
Anyway, my understanding is that everyone wants such an ability, but besides for the bikeshedding that may need to be done, the main thing holding this up is that so far no one has stepped forward with an implementation. I’m sure a PR would be welcome…