Skip to content

[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

Merged
merged 11 commits into from
Jun 24, 2022

Conversation

Jasguerrero
Copy link
Contributor

@Jasguerrero Jasguerrero commented Jun 17, 2022

#2885
As suggested by the team this should be a flag inside flutter analyze instead of a new command

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 17, 2022
@Jasguerrero Jasguerrero changed the title [flutter_tools] migrate project-validate to analyze --suggestion [flutter_tools] migrate project-validate to analyze --suggestions Jun 17, 2022
@@ -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.'
Copy link
Contributor

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?

Copy link
Contributor

@christopherfujino christopherfujino Jun 22, 2022

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 {
Copy link
Contributor

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;
Copy link
Contributor

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.

@Jasguerrero Jasguerrero force-pushed the move_validate_to_flag branch from d882f6b to 8a62570 Compare June 23, 2022 23:46
Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2022
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
autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy