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

Wrong error reporting on multiline script issues #32

Open
MartinHelmut opened this issue May 22, 2021 · 0 comments
Open

Wrong error reporting on multiline script issues #32

MartinHelmut opened this issue May 22, 2021 · 0 comments
Labels
bug A confirmed bug, something is not working.
Milestone

Comments

@MartinHelmut
Copy link
Member

Given a faulty litr.toml

[commands]
update = "git pull && git submodule update --init"
build = [
  """cmake -GNinja %{trace '-DDISASSEMBLE=ON -DTRACE=ON'} \
  -DCMAKE_BUILD_TYPE=%{target} \
  --build build/%{target go0}""",
  "ninja -C build/%{target}"
]
run = "./build/%{target foo}/src/client/Client"
test = "cd build/%{target 12}/src/tests && ctest && cd ../../../.."

[params.target]
shortcut = "t"
description = "Define the application build target."
type = ["debug", "release", "profile", "trace"]
default = "debug"

[params.trace]
shortcut = "r"
description = "Activate tracing support."
type = "boolean"

Will produce the following error:

Error: Problem parsing script!
  → /Users/martin/Projects/krieselreihe/litr/litr.toml
10 | test = "cd build/%{target 12}/src/tests && ctest && cd ../../../.."
   |                           └─ Cannot parse: Unexpected character.
 ...
4 |   """cmake -GNinja %{trace '-DDISASSEMBLE=ON -DTRACE=ON'} \
  |                                                                                                               └─ Cannot parse at `go0`: Expected `}`.
 ...
9 | run = "./build/%{target foo}/src/client/Client"
  |                           └─ Cannot parse at `foo`: Expected `}`.

The issue is the error pointer placed too far right (scroll right) due to the multiple lines used inside the script and the "line length" calculated based on that.

@MartinHelmut MartinHelmut added the bug A confirmed bug, something is not working. label May 22, 2021
@MartinHelmut MartinHelmut added this to the Version 1 milestone May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A confirmed bug, something is not working.
Projects
None yet
Development

No branches or pull requests

1 participant