Open
Description
Sometimes the content hash is quoted, sometimes not.
We use a quite naive yaml serialization for writing pubspec.lock.
Here is the regex that decides is a string needs to be json-encoded before serializing:
Line 511 in 2179b76
/// The subset of strings that don't need quoting in YAML.
///
/// This pattern does not strictly follow the plain scalar grammar of YAML,
/// which means some strings may be unnecessarily quoted, but it's much simpler.
final _unquotableYamlString = RegExp(r'^[a-zA-Z_-][a-zA-Z_0-9-]*$');
We could consider using yaml_edit to write the pubspec.lock file