Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Dependency injection Attach command #113227

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 7 commits into from
Oct 18, 2022

Conversation

Jasguerrero
Copy link
Contributor

@Jasguerrero Jasguerrero commented Oct 10, 2022

Part of: #107607

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 Oct 10, 2022
@Jasguerrero Jasguerrero marked this pull request as ready for review October 10, 2022 20:25
required ProcessInfo processInfo,
required FileSystem fileSystem,
}): _artifacts = artifacts,
_hotRunnerFactory = (hotRunnerFactory == null) ? HotRunnerFactory() : hotRunnerFactory,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_hotRunnerFactory = (hotRunnerFactory == null) ? HotRunnerFactory() : hotRunnerFactory,
_hotRunnerFactory = hotRunnerFactory ?? HotRunnerFactory(),

@@ -316,7 +345,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
).asBroadcastStream();
}

globals.terminal.usesTerminalUi = daemon == null;
_terminal.usesTerminalUi = daemon == null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems strange to me that we set this here; I would think that we would do it somewhere earlier. I'm just talking out loud though, keeping status quo LGTM for now.

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 with a nit about using ?? over ternary

@christopherfujino
Copy link
Contributor

Thanks for migrating this command!

@@ -438,7 +564,16 @@ void main() {
});

testUsingContext('exits when multiple devices connected', () async {
final AttachCommand command = AttachCommand();
final AttachCommand command = AttachCommand(
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh btw, are we still relying on all the overrides here? I would have hoped we could use testWithoutContext after this refactor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just tried using testWithoutContext but it seems like the attach command and the BufferLogger used in this tests still needs a context

Copy link
Contributor

Choose a reason for hiding this comment

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

Annoyingly FlutterCommand depends on globals :(

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