-
Notifications
You must be signed in to change notification settings - Fork 17
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
Cleanup of lint creation #41
Cleanup of lint creation #41
Conversation
factory AvoidReturningWidgetsRule.createRule(CustomLintConfigs configs) { | ||
final rule = MetricRule( |
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 seems wrong semantically. AvoidReturningWidgetsRule
isn't a metric, but uses a MetricRule
for configuring itself.
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.
Do you think merging SolidLintRule
and MetricRule
into one thing and calling it SolidLint
would be acceptable? Both rules and metrics are lints for us at the end of the day, so is it good?
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.
Yep. At the very least we can explore it. If it comes together logically -- why not.
abstract class SolidLintRule<T extends Object?> extends DartLintRule { | ||
/// Constructor for [SolidLintRule] model. | ||
SolidLintRule(this.config) : super(code: config.lintCode); | ||
|
||
/// Configuration for a particular rule with all the | ||
/// defined custom parameters. | ||
final MetricRule<T> config; |
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.
Maybe we should merge SolidLintRule and MetricRule into a single entity? This would simplify the declaration of these rules also -- it will just be an override on the rule implementation.
As we have more and more lints it's a good idea to split it, so we won't end up with a one giant method with all lints.
cc:
illia-romanenkoit was supposed to be Yurii