Open Jannik-dev opened 3 hours ago
The pubspec.yaml format is intentionally designed to be open-ended. Meaning we (mostly) leave extra properties alone. This leads to issues like this.
We are doing some spell checking on top-level properties (though only when publishing) if they have a short edit-distance to known properties.
Perhaps there is some special casing we could do for things like this.
Environment
3.5.4
Problem
I recently discovered that
pub get
worked fine when the version constraint on a hosted package has a wrong indentation.This is my example
pubspec.yaml
(version is indented too much), it essentially acts like no version is specified, which could be quite tricky to track down when the project gets older:When using the pubspec_parse (version
1.3.0
) an error is thrown which I would expect frompub get
as well.Expected behavior
An exception is thrown that there are characters which aren't in used during parsing or that the version has the wrong indentation.
Actual behavior
pub get
acts like the version line does not exist.