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

Conversation

@ookami-kb
Copy link
Contributor

@ookami-kb ookami-kb commented Sep 20, 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 prefer-extracting-callbacks (#458)
[ ] 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)

prefer-extracting-callbacks rule doesn't trigger on the empty block functions.

Is there anything you'd like reviewers to focus on?

@dkrutskikh dkrutskikh self-requested a review September 20, 2021 17:03
@incendial incendial added the type: enhancement New feature or request label Sep 20, 2021
@incendial incendial added this to the 4.4.0 milestone Sep 20, 2021
Warns about inline callbacks in a widget tree and suggests to extract them to widget methods in order to make a `build` method more readable. In addition extracting can help test those methods separately as well.

**NOTE** the rule will not trigger on arrow functions like `onPressed: () => _handler(...)` in order to cover cases when a callback needs a variable from the outside.
**NOTE** the rule will not trigger on:
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codecov
Copy link

codecov bot commented Sep 20, 2021

Codecov Report

Merging #465 (9be3638) into master (263cf63) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 9be3638 differs from pull request most recent head 68e1a70. Consider uploading reports for the commit 68e1a70 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
+ Coverage   83.32%   83.34%   +0.01%     
==========================================
  Files         188      188              
  Lines        3839     3843       +4     
==========================================
+ Hits         3199     3203       +4     
  Misses        640      640              
Impacted Files Coverage Δ
...ules_list/prefer_extracting_callbacks/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 263cf63...68e1a70. Read the comment docs.

Copy link
Member

@incendial incendial left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!

@dkrutskikh dkrutskikh merged commit 8ea29be into dart-code-checker:master Sep 20, 2021
@ookami-kb ookami-kb deleted the ookami-kb/issue458 branch September 20, 2021 22:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-rules type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants