[flutter_tools] add --null-assertions flag for debugging with null safety#63416
Merged
fluttergithubbot merged 4 commits intoAug 11, 2020
Merged
Conversation
jmagman
reviewed
Aug 11, 2020
| String flags = debuggingOptions.dartFlags ?? ''; | ||
| if (debuggingOptions.nullAssertions) { | ||
| final String separator = flags.isEmpty ? '' : ','; | ||
| flags += '$separator--null_assertions'; |
Member
There was a problem hiding this comment.
Is making a list and joining too clunky?
Contributor
Author
There was a problem hiding this comment.
Very difficult for my sleepy brain 🤣
Contributor
Author
There was a problem hiding this comment.
I just wanted you to know that I understand the fence post problem
| '--observatory-port=60700', | ||
| '--start-paused', | ||
| '--dart-flags="--foo"', | ||
| '--dart-flags="--foo,--null_assertions"', |
Member
There was a problem hiding this comment.
Is there a test that's just --null_assertions without a --foo?
Contributor
Author
There was a problem hiding this comment.
I added a unit test that tests various flag combinations in computeDartVmFlags
jmagman
approved these changes
Aug 11, 2020
| ); | ||
| argParser.addFlag(FlutterOptions.kNullAssertions, | ||
| help: | ||
| 'Whether to perform additional null checks on the boundaries of null safe and ' |
Member
There was a problem hiding this comment.
Maybe 'Perform additional null checks...
mingwandroid
pushed a commit
to mingwandroid/flutter
that referenced
this pull request
Sep 6, 2020
This was referenced Nov 11, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Make the flag available as an opt-in. A follow up PR will enable this for the flutter CI and fix the known test failures. This will insert additional null checks between null-safe and on-null safe libraries, with then intention of catching violations before all code has migrated to null safety
This flag must be off by default because it breaks a non-trivial amount of existing code
#61042