snapcraft.yaml validation errors report the line number starting from 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Low
|
Sergio Schvezov |
Bug Description
When there is a validation error in the snapcraft.yaml, it prints the line number. That line number is off-by-one because it starts indexing in 0.
To reproduce, get the attached yaml and run snapcraft:
$ snapcraft
Issues while validating snapcraft.yaml: found character '\t' that cannot start any token on line 7 of snapcraft.yaml
$ cat -n snapcraft.yaml
1 name: my-snap # the name of the snap
2 version: 0 # the version of the snap
3 summary: This is my-snap's summary # 79 char long summary
4 description: This is my-snap's description # a longer description for the snap
5 confinement: devmode # use "strict" to enforce system access only via declared interfaces
6
7 parts:
8 my-part: # line with \t
9 plugin: nil
The error is in my-part, line 8.
Changed in snapcraft: | |
status: | New → Triaged |
milestone: | none → 2.18 |
importance: | Undecided → Low |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
Here's an example of +1 the mark: http:// pyyaml. org/wiki/ PyYAMLDocumenta tion#YAMLError