Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

feat: change avoid-returning-widgets #369

Merged
merged 7 commits into from
Jun 2, 2021

Conversation

incendial
Copy link
Member

@incendial incendial commented May 31, 2021

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix
[ ] New rule
[X] Changes an existing rule
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

As mentioned here dart-archive/linter#2582 (comment) we should not lint every class method with Widget return type, because there are cases where it's totally valid to have a Widget-returning method and it's used in builders. So this request supports this approach for methods, but still lint getters and global functions as before.

@incendial incendial added the type: enhancement New feature or request label May 31, 2021
@incendial incendial added this to the 4.0.0 milestone May 31, 2021
@incendial incendial requested a review from dkrutskikh May 31, 2021 18:56
@incendial incendial self-assigned this May 31, 2021
@incendial
Copy link
Member Author

incendial commented May 31, 2021

@roman-petrov could you please a look too? I'd very happy to get your feedback about this one.

@codecov
Copy link

codecov bot commented May 31, 2021

Codecov Report

Merging #369 (4c391e4) into master (1ee3797) will increase coverage by 0.27%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #369      +/-   ##
==========================================
+ Coverage   79.16%   79.44%   +0.27%     
==========================================
  Files         155      156       +1     
  Lines        3562     3610      +48     
==========================================
+ Hits         2820     2868      +48     
  Misses        742      742              
Impacted Files Coverage Δ
...oid_returning_widgets/avoid_returning_widgets.dart 100.00% <100.00%> (ø)
...ist/avoid_returning_widgets/visit_declaration.dart 100.00% <100.00%> (ø)
...es/rules_list/avoid_returning_widgets/visitor.dart 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ee3797...4c391e4. Read the comment docs.

@incendial incendial requested a review from dkrutskikh June 2, 2021 19:12
@dkrutskikh dkrutskikh merged commit 896a72e into master Jun 2, 2021
@dkrutskikh dkrutskikh deleted the improve-avoid-returning-widgets branch June 2, 2021 20:01
@roman-petrov
Copy link
Contributor

@incendial sorry for late response, you mentioned me above but I missed @mention notification in my mail. I will try to improve my email filters to solve this, I am still quite interesting in contributing to this project.

This specific update logically looks quite good to me, returning widgets from getters for me looks even worse than returning from functions.

@incendial
Copy link
Member Author

@incendial sorry for late response, you mentioned me above but I missed @mention notification in my mail.

No problem.

This specific update logically looks quite good to me, returning widgets from getters for me looks even worse than returning from functions.

Thanks for taking a look!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants