-
Notifications
You must be signed in to change notification settings - Fork 39
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
Bugfix. Unused_import rule should ignore all standard operator funs #880
Conversation
### What's done: * Fixed bug * Added test
Codecov Report
@@ Coverage Diff @@
## master #880 +/- ##
============================================
- Coverage 83.53% 83.51% -0.03%
Complexity 2215 2215
============================================
Files 101 101
Lines 5690 5689 -1
Branches 1628 1628
============================================
- Hits 4753 4751 -2
Misses 256 256
- Partials 681 682 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
// Fixme: this imports should be deleted if unused | ||
private val ignoreOperators = setOf("getValue", "plus", "minus", "times", "div", | ||
"rem", "rangeTo", "contains", "plusAssign", "minusAssign", "timesAssign", | ||
"divAssign", "remAssign", "compareTo", "inc", "dec", "unaryPlus", "unaryMinus", "not") | ||
|
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.
Can we supplement the dictionary with operatorMap operators in AstConstants.kt so that these operators are not ignored?
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.
Fixed
### What's done: * Fixed bug
) | ||
} | ||
|
||
@Disabled |
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 provide a reason
importName | ||
) | ||
) { | ||
} else if (importName != null && !ignoreImports.contains(importName) && !refSet.contains(importName) && !operatorMap.containsKey(importName)) { |
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.
Why did you disable deleting imports from operatorMap?
### What's done: * Fixed bug
What's done:
This pull request closes #837