travis-ci / travis-yaml

parses, normalizes, validates and serializes your .travis.yml
http://yaml.travis-ci.org/
MIT License
170 stars 66 forks source link

Source locations on error are wrong #128

Open vgvassilev opened 6 years ago

vgvassilev commented 6 years ago

This is a pretty terrible one I run into. Luckily I came across https://github.com/ruby/psych/issues/190 and solved my issue rather quickly.

Original bug report:

When parsing this yaml

key_one:
  inner:
  - value1
  - value2

key_two:
    inner:
  - value1
  - value2

the error message

Psych::SyntaxError: (/tmp/oops.yaml): did not find expected key while parsing a block mapping at line 1 column 1

contains the wrong line number. It should be reporting line 7 column 5.

I ran into a slightly different problem key: "VAR="OTHER_VAR"" but still the source locations were wrong.