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

Remove unused code from tests #104550

Merged
merged 2 commits into from May 25, 2022
Merged

Conversation

goderbauer
Copy link
Member

The dead code was found by running dart run dart_code_metrics:metrics check-unused-code test from https://pub.dev/packages/dart_code_metrics in packages/flutter.

Other notes about the tool:

  • The tool didn't find anything interesting in non-test code of the framework.
  • There were a few false positives in the framework and in test code.

@flutter-dashboard flutter-dashboard bot added a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: text input Entering text in a text field or keyboard related problems f: gestures flutter/packages/flutter/gestures repository. f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels May 24, 2022
@goderbauer
Copy link
Member Author

Regarding the dead code this tool found in tests: Ideally, we'd want to avoid accumulating this and there are a couple of lint proposals that would help: dart-lang/linter#1258, dart-lang/linter#685, dart-lang/linter#2395. I believe, any of these would have avoided the dead code from making (or remaining) in the repository. (cc @pq)

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Excellent!

@pq
Copy link
Contributor

pq commented May 25, 2022

This is pretty amazing. Nice. Thanks for sharing. And cheers to the dart_code_metrics folks! 🍻

@incendial
Copy link

@goderbauer hi, co-author of Dart Code Metrics here 🙂. So happy to see that the tool helped find and remove unused code! Could you please share more details about the false-positives part? If you don't think this PR is a great place to discuss it, feel free to open an issue here https://github.com/dart-code-checker/dart-code-metrics/issues/new/choose

This is pretty amazing. Nice. Thanks for sharing. And cheers to the dart_code_metrics folks! 🍻

Thank you! ❤️

engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: text input Entering text in a text field or keyboard related problems f: gestures flutter/packages/flutter/gestures repository. f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants