-
Notifications
You must be signed in to change notification settings - Fork 182
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 support to disable symbol via regex #669
Changes from 3 commits
d64262f
e166870
4d793fe
22c68e5
7510531
92ae2c6
0c3f2d1
29f0cb3
b7028d8
f0b2623
f8204ec
309bd56
a539f75
3771bb2
04a0bc3
cb0f471
97c963e
0382d78
5261cc9
4e2d38f
76d2007
175ce0b
b40d16e
10eeaee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,12 +29,9 @@ object DisableRegex { | |
import scala.collection.mutable // ok | ||
|
||
@SuppressWarnings(Array("Disable.ListBuffer")) | ||
@SuppressWarnings(Array("Disable.<init>")) | ||
val buffer = new ListBuffer[Int]() | ||
|
||
@SuppressWarnings(Array("Disable.mutable")) | ||
@SuppressWarnings(Array("Disable.HashMap")) | ||
@SuppressWarnings(Array("Disable.<init>")) | ||
val abc = new mutable.HashMap[String, String]() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intuitively, there is only one symbol being referenced here I think it would make sense to skip the qualifier of a a.b.C // only report on C
d.E // only report on E
f.g(1).h // report on h and g It should be simple to do this check with something like def skipQualifier(qual: Term) Boolean = qual match {
case _: Term.Name => true
case Term.Select(q, _) => skipQualifier(q)
} |
||
|
||
object IO { // IO we deserve | ||
|
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.
What happens if you have a more complex qualifier in a select?
and
a
andc
are banned? I would expect there to be two lint errorsThere 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.
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 opened #679 and assigned the ticket to you @vovapolu . I will go ahead and merge to unblock a release, but please be sure to follow up on that ticket as I think the current change results in surprising behavior.