Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Issue 167 1#186

Merged
yurii-prykhodko-solid merged 15 commits into
solid-software:mastersolid-software/solid_lints:masterfrom
StarovNikita:issue-167-1StarovNikita/solid_lints:issue-167-1Copy head branch name to clipboard
Dec 6, 2024
Merged

Issue 167 1#186
yurii-prykhodko-solid merged 15 commits into
solid-software:mastersolid-software/solid_lints:masterfrom
StarovNikita:issue-167-1StarovNikita/solid_lints:issue-167-1Copy head branch name to clipboard

Conversation

@StarovNikita

Copy link
Copy Markdown
Contributor

No description provided.

@yurii-prykhodko-solid yurii-prykhodko-solid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add at least one test per each rule, where we check whether the exclusion logic is working properly.

And please make sure the pipeline is passing.

Comment thread lib/src/lints/avoid_unused_parameters/avoid_unused_parameters_rule.dart Outdated
Comment thread lib/src/lints/cyclomatic_complexity/cyclomatic_complexity_rule.dart Outdated
Comment thread lib/src/lints/no_empty_block/models/no_empty_block_parameters.dart Outdated
Comment thread lint_test/analysis_options.yaml Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread lib/src/lints/no_empty_block/models/no_empty_block_parameters.dart Outdated
Comment thread lint_test/function_lines_of_code_test/analysis_options.yaml Outdated
final excludedItem =
exclude.firstWhereOrNull((e) => e.methodName == methodName);
final excludedItem = exclude.firstWhereOrNull(
(e) => e.methodName == methodName || e.className == methodName,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes some confusion.

And also highlights that we may not be comparing what we think we should be comparing.

We should check whether the declaration is a class before running exclude.className == declarationName; same for method names.

Suggested change
(e) => e.methodName == methodName || e.className == methodName,
(e) => e.methodName == declarationName || e.className == declarationName,

@yurii-prykhodko-solid yurii-prykhodko-solid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, almost there. Please add tests for plain-string exclude.

Comment thread lib/src/common/parameters/excluded_identifiers_list_parameter.dart
Comment thread lib/src/common/parameters/excluded_identifiers_list_parameter.dart
Comment on lines +10 to +11
- method_name: longFunctionExcluded
- method_name: longMethodExcluded

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this back. If no tests fail -- we're good to go.

Suggested change
- method_name: longFunctionExcluded
- method_name: longMethodExcluded
- longFunctionExcluded
- longMethodExcluded

Comment on lines +53 to +61
for (final item in excludeList) {
if (item is Map) {
exclude.add(ExcludedIdentifierParameter.fromJson(item));
} else if (item is String) {
exclude.add(
ExcludedIdentifierParameter(
declarationName: item,
),
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace all this with a call to another factory, to avoid duplication

  return ExcludedIdentifiersListParameter.fromJson(excludeList: excludeList);

@yurii-prykhodko-solid yurii-prykhodko-solid merged commit 3e1711b into solid-software:master Dec 6, 2024
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.