-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[flutter_tools] migrate project-validate to analyze --suggestions #106149
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
[flutter_tools] migrate project-validate to analyze --suggestions #106149
Conversation
@@ -56,6 +60,9 @@ class AnalyzeCommand extends FlutterCommand { | |||
help: 'The path to write the request and response protocol. This is ' | |||
'only intended to be used for debugging the tooling.', | |||
hide: !verboseHelp); | |||
argParser.addOption('suggestions', | |||
help: 'Show suggestions about the current flutter project.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From reading the code, it sounds like it's not the "current" project, but whatever project is at the path pointed to by this option, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I suggest you make this usage consistent with the rest of flutter analyze (from a brief look at the code, there's a --current-package
flag, that defaults to on, and then the argResults.rest
is parsed as directories or files and canonicalized)
} | ||
directoryPath = items.first; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit: put this else
on the previous line
@@ -119,7 +129,31 @@ class AnalyzeCommand extends FlutterCommand { | |||
|
|||
@override | |||
Future<FlutterCommandResult> runCommand() async { | |||
if (boolArgDeprecated('watch')) { | |||
final bool? suggestionFlag = boolArg('suggestions'); | |||
final Set<String> items; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be declared where it is set, on line 141. If someone later adds code that tries to reference this outside the scope where it's initialized, it will be a runtime error that the compiler can't catch.
d882f6b
to
8a62570
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#2885
As suggested by the team this should be a flag inside
flutter analyze
instead of a new commandPre-launch Checklist
///
).