snapcraft.yaml validation errors report the line number starting from 0

Bug #1621166 reported by Leo Arias
10
This bug affects 2 people
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.

Revision history for this message
Leo Arias (elopio) wrote :
Revision history for this message
Leo Arias (elopio) wrote :
description: updated
Changed in snapcraft:
status: New → Triaged
milestone: none → 2.18
importance: Undecided → Low
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: Triaged → Fix Committed
assignee: nobody → Sergio Schvezov (sergiusens)
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.