Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync(tests): improve error for invalid TOML (#614)
A manually edited `tests.toml` file might contain invalid TOML. For example: [2ee1d9af-1c43-416c-b41b-cefd7d4d2b2a] description = encode yes where `encode yes` is invalid [1] because it is unquoted. Before this commit, `configlet sync` would not handle the TOML parsing exception: $ cd /tmp $ git clone --quiet https://github.com/exercism/common-lisp $ cd common-lisp $ git checkout f521b1fb0f04ffc2d5baa6cf0bba37c231cc1bd7 $ bin/fetch-configlet $ bin/configlet sync --tests Updating cached 'problem-specifications' data... Checking exercises... parsetoml.nim(908) parseValue Error: unhandled exception: /tmp/common-lisp/exercises/practice/affine-cipher/.meta/tests.toml(6:16) unexpected character "e" [TomlError] With this commit, configlet still exits immediately, but handles the exception: $ configlet sync --tests Updating cached 'problem-specifications' data... Checking exercises... Error: A 'tests.toml' file contains invalid TOML: /tmp/common-lisp/exercises/practice/affine-cipher/.meta/tests.toml(6:16) unexpected character "e" The expected 'tests.toml' format is documented in https://exercism.org/docs/building/configlet/sync#h-tests Note that `configlet lint` does not yet lint `tests.toml` files, and so invalid TOML does not yet cause `configlet lint` to indicate an error. [1] https://toml.io/en/v1.0.0#string Fixes: #613
- Loading branch information