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

If dependencies is empty, add const #2310

Merged
merged 7 commits into from
Apr 7, 2023
Merged

If dependencies is empty, add const #2310

merged 7 commits into from
Apr 7, 2023

Conversation

K9i-0
Copy link
Contributor

@K9i-0 K9i-0 commented Mar 13, 2023

When creating a provider with an empty list for dependencies, a warning was raised.
I fixed it by adding const.

SCR-20230313-ljy

https://dart-lang.github.io/linter/lints/prefer_const_literals_to_create_immutables.html

@K9i-0 K9i-0 marked this pull request as ready for review March 13, 2023 06:51
@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Merging #2310 (21b50a7) into master (a823388) will increase coverage by 4.74%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #2310      +/-   ##
===========================================
+ Coverage   95.25%   100.00%   +4.74%     
===========================================
  Files          53         3      -50     
  Lines        2253        74    -2179     
===========================================
- Hits         2146        74    -2072     
+ Misses        107         0     -107     

see 50 files with indirect coverage changes


expect(
emptyDependenciesStatefulProvider.dependencies,
const <ProviderOrFamily>[],
Copy link
Owner

Choose a reason for hiding this comment

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

Those tests would pass even without the const. Wrap the list in a "same()"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wrapped it with "same()"👍

87a14ca

@K9i-0 K9i-0 requested a review from rrousselGit March 13, 2023 08:05
@@ -106,6 +106,18 @@ void main() {
transitiveDependenciesProvider.dependencies,
same(transitiveDependenciesProvider.dependencies),
);
expect(
smallTransitiveDependencyCountProvider.dependencies,
same(smallTransitiveDependencyCountProvider.dependencies),
Copy link
Owner

Choose a reason for hiding this comment

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

That's not what I meant

Do same(const <ProviderOrFamily>[])

Copy link
Contributor Author

@K9i-0 K9i-0 Mar 13, 2023

Choose a reason for hiding this comment

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

I Wrote the code this way in commit cef6d9c because it is a test to check if the dependencies are cached

In commit 87a14ca, I have incorporated the feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rrousselGit I have responded to the comment you provided, and I would appreciate it if you could take a moment to review my response

@rrousselGit
Copy link
Owner

LGTM, thanks a lot !

@rrousselGit rrousselGit merged commit 0fc89f6 into rrousselGit:master Apr 7, 2023
@K9i-0 K9i-0 deleted the add_const_to_empty_dependencies branch April 7, 2023 11:43
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