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

dart fix needs a verbose option #57014

Open
firephreek opened this issue Nov 1, 2024 · 2 comments
Open

dart fix needs a verbose option #57014

firephreek opened this issue Nov 1, 2024 · 2 comments
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-fix type-enhancement A request for a change that isn't a bug

Comments

@firephreek
Copy link
Contributor

Running dart fix --dry-run returns the following information, which, on its own, isn't helpful in identifying actual problems I might want to address/correct. Adding a verbose option to include the associated information found running dart analyze would be more helpful.

dart fix

$ dart fix --dry-run

Computing fixes in my_app (dry run)... 3.1s

4 proposed fixes in 3 files.

lib/blocs/trial_recorder/bloc.dart
  unused_catch_stack • 1 fix

lib/views/lab/configuration_view.dart
  annotate_overrides • 1 fix
  sized_box_for_whitespace • 1 fix

lib/views/trial/playback_controls.dart
  unused_import • 1 fix

dart analyze

$ dart analyze
Analyzing physics_workbench...         1.8s

warning • lib/blocs/trial_recorder/bloc.dart:28:17 • The stack trace variable 's' isn't used and can be removed. Try removing the stack trace variable, or using it. • unused_catch_stack
warning • lib/views/trial/playback_controls.dart:6:8 • Unused import: 'common.dart'. Try removing the import directive. • unused_import
   info • lib/views/lab/configuration_view.dart:10:10 • The member 'build' overrides an inherited member but isn't annotated with '@override'. Try adding the '@override' annotation. • annotate_overrides
   info • lib/views/lab/configuration_view.dart:15:9 • Use a 'SizedBox' to add whitespace to a layout. Try using a 'SizedBox' rather than a 'Container'. • sized_box_for_whitespace

4 issues found.

General info

Project info

  • sdk constraint: '^3.5.3'
  • dependencies: camera, camera_android_camerax, cupertino_icons, equatable, flutter, flutter_bloc, logger, sensors_plus, video_player
  • dev_dependencies: flutter_lints, flutter_test

Process info

Memory CPU Elapsed time Command line
63 MB 0.0% 06:45 dart devtools --machine --dtd-uri=ws:/cHfX8RemmD77FPbt
64 MB 0.0% 1-12:03:39 dart devtools --machine --dtd-uri=ws:/dVIDFBz6XYb6xGfB
21 MB 0.0% 21-01:16:57 dart devtools --machine --dtd-uri=ws:/uE8BvAql3YYrbpgR
654 MB 1.2% 1-12:03:43 dart language-server --client-id=Android-Studio --client-version=AI-242.21829.142 --protocol=analyzer
520 MB 6.0% 01:48 dart language-server --client-id=Android-Studio --client-version=AI-242.21829.142 --protocol=analyzer
20 MB 0.0% 21-01:16:57 dart tooling-daemon --machine
82 MB 0.0% 1-12:03:39 dart tooling-daemon --machine
81 MB 0.1% 06:45 dart tooling-daemon --machine
81 MB 4.1% 02:01 flutter_tools.snapshot daemon
@dart-github-bot
Copy link
Collaborator

Summary: The user requests a verbose option for dart fix to include the output from dart analyze, providing more context for the proposed fixes. Currently, dart fix --dry-run only shows a list of fixes without the underlying analysis information.

@dart-github-bot dart-github-bot added area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug labels Nov 1, 2024
@bwilkerson
Copy link
Member

If we were to implement this, one question would be whether to show diagnostics for which there is no fix. My first guess is no because the unfixable diagnostics aren't relevant to the question of whether to re-run it with an --apply flag.

@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-fix type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants