-
Notifications
You must be signed in to change notification settings - Fork 18
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
issue-93. added new consider_making_a_member_privat rule #188
Conversation
class X { | ||
// expect_lint:consider_making_a_member_private | ||
void unusedX() {} | ||
|
||
// no lint | ||
void usedX() {} | ||
} | ||
|
||
class Y { | ||
// no lint | ||
void _y() { | ||
final x = X(); | ||
x.usedX(); | ||
} | ||
} |
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.
Add more tests for:
- fields (static, final, mutable)
- getters, setters
- methods (static/instance)
- constructors, factories
We should also consider this for non-class declarations (global functions, variables, constants) and class declarations as a whole.
class Y { | ||
// no lint | ||
void _y() { | ||
final x = X(); | ||
X.usedFactory(); | ||
x.usedMethodX(); | ||
usedGLobalFunction(); | ||
usedGlobalVariables; | ||
} | ||
} |
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.
This is not quite what the lint is supposed to do.
With the structure of the test, all these methods and functions could just as well be private too.
We should lint if the class/method/functions are not used outside the file where they are declared.
No description provided.