Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line numbers reported incorrectly when YAML document starts with trivia #1956

Open
martincostello opened this issue Feb 26, 2024 · 0 comments
Labels

Comments

@martincostello
Copy link

Describe the bug

If line is used to get the line number of a match, the value is incorrectly offset by the number of lines at the start of the document that are trivia before the first key.

Version of yq: 4.42.1
Operating system: Ubuntu 22.04.2
Installed via: Binary from GitHub releases

Input Yaml

---

foo:
  bar: 42

Command

The command you ran:

yq ".foo.bar | line"

Actual behavior

2

Expected behavior

4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant