Skip to content
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

Merged
merged 2 commits into from
Aug 14, 2023
Merged

Cleanup of lint creation #41

merged 2 commits into from
Aug 14, 2023

Conversation

n-bernat
Copy link
Contributor

@n-bernat n-bernat commented Aug 11, 2023

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-romanenko it was supposed to be Yurii

Comment on lines +18 to +19
factory AvoidReturningWidgetsRule.createRule(CustomLintConfigs configs) {
final rule = MetricRule(
Copy link
Collaborator

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

Comment on lines +6 to +12
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;
Copy link
Collaborator

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.

@solid-yuriiprykhodko solid-yuriiprykhodko merged commit 35ccded into solid-software:release-v0.1.0 Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants