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

INTL-1793 : Have over_react_codemod show deprecation message #276

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion lib/src/executables/intl_message_migration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ final parser = ArgParser()
late ArgResults parsedArgs;

void main(List<String> args) async {
printDeprecationNotice();
parsedArgs = parser.parse(args);
if (parsedArgs['help'] as bool) {
printUsage();
Expand Down Expand Up @@ -154,6 +155,7 @@ void main(List<String> args) async {
args: codemodArgs,
additionalHelpOutput: parser.usage,
);

if (exitCode != 0) return;
logWarning('^ Ignore the "codemod found no files" warning above for now.');

Expand Down Expand Up @@ -210,14 +212,32 @@ void main(List<String> args) async {
}
}

void printDeprecationNotice() {
printInRed(
'***** Attention Users of over_react_codemod:intl_message_migration *****');
chetansinghchoudhary-wk marked this conversation as resolved.
Show resolved Hide resolved
printInBlue(
'# This version of intl_migration is deprecated and will no longer receive updates.');
stderr.writeln(
chetansinghchoudhary-wk marked this conversation as resolved.
Show resolved Hide resolved
'# We recommend switching to the dart_dev / dart_dev_workiva versions for intl_codemod, which provide improved functionality and support.');

/// TODO: The link to the wiki will be updated here once INTL-1792 done.
stderr.writeln(
'# Refer to the documentation https://wiki.atl.workiva.net/display/FEF/Internationalization of dart_dev / dart_dev_workiva for more information on using intl_codemod with dart_dev.');
}

void printInBlue(String text) {
print(ansi.blue.wrap(text));
}

void printInRed(String text) {
print(ansi.red.wrap(text));
}

void printUsage() {
stderr.writeln(
'Migrates literal strings that seem user-visible in the package by wrapping them in Intl.message calls.');
stderr.writeln();

printDeprecationNotice();
stderr.writeln('Usage:');
stderr.writeln(' intl_message_migration [arguments]');
stderr.writeln();
Expand Down
Loading