Skip to content

Conversation

@tonyzhao1
Copy link
Contributor

Moves the error messages produced by validators to a single central class that they all reference.

@tonyzhao1
Copy link
Contributor Author

@mehmetf @tvolkert

/// Class containing the messages that can be produced by the doctor validators.
/// Members are split by validator and are given in the order they appear in the
/// validator code.
class ErrorMessages {
Copy link
Contributor

Choose a reason for hiding this comment

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

These are all the messages so let's just call them Messages or Strings since messages seems to conflict in some files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or perhaps UserMessages (as opposed to bus messages, for instance)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Named to UserMessages.


ErrorMessages get errorMessages => context[ErrorMessages];

/// Class containing the messages that can be produced by the doctor validators.
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 class can be more general than just for validators - we could grow it to use it for thrown exceptions as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That seems likely. Changed the doc comment to be more general.

@@ -0,0 +1,175 @@
import '../ios/cocoapods.dart';
Copy link
Contributor

Choose a reason for hiding this comment

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

For this and vscode_validator.dart, let's factor out anything that causes these dependencies into parameters for the message (e.g. VsCodeValidator.extensionMarketplaceUrl). That way, we won't have dependencies on these files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@tvolkert tvolkert 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 nit

the class and take them as arguments instead.
@tonyzhao1
Copy link
Contributor Author

@tvolkert Comments addressed, ready for merging (I don't have write access)

@tvolkert tvolkert added this to the bucket12 milestone Nov 6, 2018
@tvolkert
Copy link
Contributor

tvolkert commented Nov 6, 2018

@tonyzhao1 as discussed offline, I'm putting this in the bucket12 milestone for later merging.

@zoechi zoechi added tool Affects the "flutter" command-line tool. See also t: labels. t: flutter doctor Problem related to the "flutter doctor" tool labels Nov 28, 2018
@tvolkert
Copy link
Contributor

Ok @tonyzhao1 now that we're past 1.0 and the tree is unfrozen, I'm game to merge this, but there are now merge conflicts. Can you rebase and resolve conflicts?

# Conflicts:
#	packages/flutter_tools/lib/src/context_runner.dart
#	packages/flutter_tools/lib/src/ios/ios_workflow.dart
#	packages/flutter_tools/lib/src/vscode/vscode_validator.dart
@tvolkert tvolkert merged commit f8ab726 into flutter:master Dec 19, 2018
@Hixie
Copy link
Contributor

Hixie commented Dec 20, 2018

There's lots of strings that aren't covered by this, what's the long term plan here? What problem does this solve?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants