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

User friendly config parse errors in tab --check #358

Open
jdisanti opened this issue May 23, 2021 · 0 comments
Open

User friendly config parse errors in tab --check #358

jdisanti opened this issue May 23, 2021 · 0 comments

Comments

@jdisanti
Copy link
Contributor

Thanks for building this!

I found a config parsing error that could be improved, but it looks fairly involved. Using the following config:

workspace:
  - repo: some-repo/
  - tab: some-repo-1
  - doc: "some top-level tab"

Will result in an error that requires cross comparing with an example or looking at an enum in code to figure out why it didn't work (the doc key shouldn't have its own hyphen in this particular example):

$ tab --check
1 error was detected:
    - Failed to deserialize config at path: /home/jdisanti/src/tab.yml - error: data did not match any variant of untagged enum Config

Ideally, this error message would be more along the lines of:

1 error was detected:
    - /home/jdisanti/src/tab.yml line 4, col 3: unknown workspace field 'doc'

This appears to be a serde bug: serde-rs/serde#773

I think there are two options for improving the error:

  1. Refactor config deserialization to work around the serde issue
  2. Contribute a fix to serde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant