Merge lp://qastaging/~sergiusens/snapcraft/yaml-tabs into lp://qastaging/~snappy-dev/snapcraft/core

Proposed by Sergio Schvezov
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 168
Merged at revision: 156
Proposed branch: lp://qastaging/~sergiusens/snapcraft/yaml-tabs
Merge into: lp://qastaging/~snappy-dev/snapcraft/core
Prerequisite: lp://qastaging/~sergiusens/snapcraft/yaml_init
Diff against target: 47 lines (+29/-0)
2 files modified
snapcraft/tests/test_yaml.py (+25/-0)
snapcraft/yaml.py (+4/-0)
To merge this branch: bzr merge lp://qastaging/~sergiusens/snapcraft/yaml-tabs
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+270331@code.qastaging.launchpad.net

Commit message

Provide a nice error when tabs found in snapcraft.yaml

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

I think we need a UX opinion here. The \t character is not visible, so it could be hard to find. And that's assuming that the user knows what is \t and about parsing tokens. We are targeting package maintainers here, so maybe that's safe to assume.

I understand that with yaml, the leading spaces are important so we can't just strip them.

The alternative I see is to show a more useful message saying that X line on the yaml starts with an empty space, but that would mean catching and parsing the errors, or modifying the parser. Both alternatives suck.

How hard would it be to show the file name and line number in the error?
Do we have somebody from UX to ask this kind of things?

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On Mon, Sep 7, 2015 at 7:55 PM, Leo Arias <email address hidden> wrote:

> I think we need a UX opinion here. The \t character is not visible, so it
> could be hard to find. And that's assuming that the user knows what is \t
> and about parsing tokens. We are targeting package maintainers here, so
> maybe that's safe to assume.
>
> I understand that with yaml, the leading spaces are important so we can't
> just strip them.
>

Right, stripping a tab might bring in the problem of multiline sequences
being incorrectly parsed.

>
> The alternative I see is to show a more useful message saying that X line
> on the yaml starts with an empty space, but that would mean catching and
> parsing the errors, or modifying the parser. Both alternatives suck.
>

This may be doable, line number and line context?

How hard would it be to show the file name and line number in the error?
>

Line number, easy, file name easy but I don't think it is necessary as it
is a SnapcraftYaml specific Error

> Do we have somebody from UX to ask this kind of things?
>

Mark :-)

167. By Sergio Schvezov

improve exception message

168. By Sergio Schvezov

Merged yaml_init into yaml-tabs.

Revision history for this message
Ted Gould (ted) wrote :

I think this is good enough to get started, but we should probably design errors more holistically at some point. But I don't think we have enough to start that yet. And people rarely depend on them.

review: Approve
Revision history for this message
Leo Arias (elopio) wrote :

agree.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches