-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plugin option for global filters #14
Conversation
…ers=[semi-colon separated message patterns]
@@ -0,0 +1,10 @@ | |||
package testdata | |||
|
|||
object globallyFiltered { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write this test so that there's one warning suppressed and one similar warning unsuppressed (e.g. one that doesn't match the regex). This way we test if silencer only suppresses exactly what we want it to suppress and we also avoid changing the multiple files compilation
test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
private lazy val reporter = | ||
new SuppressingReporter(global.reporter, globalFilters) | ||
|
||
override def processOptions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use single-line formatting and remove procedure syntax, e.g.
override def processOptions(options: List[STring], error: String => Unit): Unit = {
import scala.reflect.internal.util.{Position, SourceFile} | ||
import scala.tools.nsc.reporters.Reporter | ||
|
||
class SuppressingReporter(original: Reporter) extends Reporter { | ||
class SuppressingReporter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the parameters in a single line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such line would exceed 80cols
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have such limit in silencer
project, currently I have formatting enforced by IntelliJ and it limits lines to 120 columns which for me is more sensible. You can also move extends Reporter {
to next line but leave parameters in a single line.
Good job, thanks a lot! |
looks useful — would like to try it out in a release |
should this PR have included README changes? |
I'll try to update README and do a release until the end of this week. |
Support minimal global filter as plugin option
-P:silencer:globalFilters=[semi-colon separated message patterns]
See example