-
Notifications
You must be signed in to change notification settings - Fork 87
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
json parser tries to parse nested toml #469
Comments
When attempting to parse a configuration file, all three parsers are tried and the result of the first successful is used. In this case, all three are failing as shown in the error message above. The TOML parser is second in the array (index 1), so the following output is relevant:
No line/column information is provided, but I think it is referring to the following key name as being invalid because it includes a dot: |
Hi @DavidAnson thanks for your answer. I tried a bit around with the setup and made some observations:
That said, the file example stated above seems to me like a valid toml format: https://toml.io/en/v1.0.0#table So it seems to me there is either a bug in the used toml parser or the parser doesn't accept the whole toml spec. |
This is the TOML parser that is used now: https://www.npmjs.com/package/toml It says it supports version 0.4.0 of the specification which I confirm prohibits dots in key names: https://toml.io/en/v0.4.0#table If you know of another well-used, dependency-free TOML parser for Node that supports a more recent version, I can have a look at switching to that. |
…-toml that exports CommonJS instead of a Module (refs #469).
Hi @DavidAnson, I'm not a node/js developer so I also have no experience in that regard. Searching through npm this one seems the most promising:
Edit: Seems like you came to the same conclusion a bit earlier 😄 |
…cification (vs. v0.4.0) (fixes #469).
I think this is a bug from #113
I'm having trouble getting the new config options to work with pre-commit:
pre-commit-config.yaml
pyproject.toml
I get the following error:
Seems like it tries to apply the JSON Parser first to the toml file.
After that the right configuration is found with the toml parser and the actual formatting is taking place but the prior error is causing the action to exit with status code 1.
This is especially problematic in ci workflows which rely on actions exit with status code 0 to pass
The text was updated successfully, but these errors were encountered: