-
Notifications
You must be signed in to change notification settings - Fork 166
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
[ New Rule ] No unused imports #417
[ New Rule ] No unused imports #417
Conversation
ce85bbe
to
746cc7a
Compare
@juanpcapurro This is a cool rule! Thanks for that. |
Hi Diego, this PR is not in a mergable state sadly, since it still has many false positives yet. so far I've found the implementation errors out when an imported name is used as:
and also has the following errors:
so a full review isn't in order yet. However, I'd of course greatly appreciate feedback on how I'm approaching the fix, if I'm organizing the code right, those kinds of things. Small chores, such as not repeating myself for the different errors that have the same message, I'll probably fix later when I have the entire feature figured out though. edit: the way I'm looking for false positives is by running the linter against a 'real world' codebase and checking manually. I'd love to hear on better ways to do it (either because it's faster or because the assertions can more easily be part of our codebase) if you have any ideas |
746cc7a
to
c7bc302
Compare
Ok, no worries... You made such great contributions here... I cannot say other thing than thank you. |
c7bc302
to
0c04b16
Compare
recognize usages in: - using Library for Type - variable definitions - member access - type cast (through FunctionCall AST node) - revert value (through FunctionCall AST node) - New expressions - array type definitions recognizing & reporting the aliased import where applicable
9deadef
to
3be5f80
Compare
@fvictorio @dbale-altoros ✨ should be ready for review now ✨ |
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 tested it and seems pretty tight
Great to see this rule being added, any idea on when the next release will be? |
This rule is already released in solhint-community 3.5.1, where a few devs and myself are continuing development |
@0xCourtney |
@juanpcapurro Como estas ? Gracias y disculpa la molestia |
I've modified both openzeppelin-contracts and exactly to manually add this rule and check for false positives, couldn't find any in the current implementation. However, I'm concerned I might be forgetting to register some usage regarding inline assembly or some other less-used feature, so feedback is of course appreciated on that.
as always, see git history for details.