-
Notifications
You must be signed in to change notification settings - Fork 229
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
pub outdated: added clear message for null safe packages #2898
Conversation
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.
This will also need some testing.
Look in test/outdated/outdated_test.dart and see if you can make a test-case that prints this.
I have added the message to Also, for adding a unit test I tried creating a test case as follows: test('null-safety already migrated', () async {
await servePackages((builder) => builder
..serve('foo', '1.0.0', pubspec: {
'environment': {'sdk': '>=2.9.0 < 3.0.0'}
})
..serve('foo', '2.0.0', deps: {
'bar': '2.0.0'
}, pubspec: {
'environment': {'sdk': '>=2.12.0 < 3.0.0'}
})
..serve('bar', '1.0.0', pubspec: {
'environment': {'sdk': '>=2.9.0 < 3.0.0'}
})
..serve('bar', '2.0.0', deps: {
'foo': '2.0.0'
}, pubspec: {
'environment': {'sdk': '>=2.12.0 < 3.0.0'}
}));
await d.dir(appPath, [
d.pubspec({
'name': 'app',
'version': '1.0.0',
'dependencies': {
'foo': '^2.0.0',
'bar': '^2.0.0',
},
'environment': {'sdk': '>=2.12.0 < 3.0.0'},
}),
]).create();
await pubGet(environment: {'_PUB_TEST_SDK_VERSION': '2.13.0'});
await variations('null_safety_already_migrated',
environment: {'_PUB_TEST_SDK_VERSION': '2.13.0'});
});
But I am facing a problem in creating the golden file for it! Can you please guide me on how to create a golden file for the same? |
Yes - you should be able to create the golden file by running the test. If the golden file doesn't exist it will be created. If it exists the actual value will be compared with the file. |
@sigurdm I have added the test case. Kindle review, and suggest changes if any. |
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
Big thanks for the contribution! |
Description
The
pub outdated --mode=null-safety
command gives confusing comments for packages that are already null safe. I have added a message i.e.All dependencies opt in to null-safety.
in a case when there are no dependencies shown inside the table.Fixes #2745
@sigurdm PTAL and suggest changes if any.