-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Default Ruff configuration file reports schema error #9630
Comments
Thanks -- let me check if the schema is out-of-date. We have to update it manually and it sometimes slips through the cracks during releases. |
The PR is here: SchemaStore/schemastore#3549. But I don't expect any of those to fix the specific error you're reporting, those settings were added long ago. Let me try in VS Code. |
It seems like the |
Ah, I see, it's specifically this line: # Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic" |
Thanks for reporting this, should be fixed by #9632. |
## Summary If you paste in the TOML for our default configuration (from the docs), it's rejected by our JSON Schema: ![Screenshot 2024-01-23 at 10 08 09 PM](https://github.com/astral-sh/ruff/assets/1309177/7b4ea6e8-07db-4590-bd1e-73a01a35d747) It seems like the issue is with: ```toml # Set the line length limit used when formatting code snippets in # docstrings. # # This only has an effect when the `docstring-code-format` setting is # enabled. docstring-code-line-length = "dynamic" ``` Specifically, since that value uses a custom Serde implementation, I guess Schemars bails out? This PR adds a custom representation to allow `"dynamic"` (but no other strings): ![Screenshot 2024-01-23 at 10 27 21 PM](https://github.com/astral-sh/ruff/assets/1309177/ab7809d4-b077-44e9-8f98-ed893aaefe5d) This seems like it should work but I don't have a great way to test it. Closes #9630.
Ruff config gives a .toml file that is equivalent to the default configuration.
Even Better TOML reports an error in that .toml file:
{"quote-style":"double","indent-style":"space","skip-magic-trailing-comma":false,"line-ending":"auto","docstring-code-format":false,"docstring-code-line-length":"dynamic"} is not valid under any of the given schemas
I reported this in the .toml validator used by Even Better TOML: Taplo issue tracker #536 and they tell me the .toml file does not match the schema and that:
and that there's an issue for this in SchemaStore.
I couldn't find another issue here about it, so here one is.
The text was updated successfully, but these errors were encountered: