-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
restore: cargo.toml #4544
restore: cargo.toml #4544
Conversation
Thanks for the PR! This section of the codebase is owned by @yassun7010 - if they write a comment saying "LGTM" then it will be merged. |
for more information, see https://pre-commit.ci
Thank you for making this PR. However, I ran into some issues this afternoon. Here are some contents in my [profile.dev]
codegen-units = 1
debug = 2
debug-assertions = true
incremental = true
opt-level = 2
overflow-checks = true And I use the schema here, which is: #:schema https://raw.githubusercontent.com/SchemaStore/schemastore/542d8d8efe76b1e38d2d7d3a4a0237636c379c47/src/schemas/json/cargo.json Error messages of my CI ^ Additional properties are not allowed ('codegen-units', 'debug', 'debug-assertions', 'incremental', 'opt-level', 'overflow-checks' were unexpected) Thank you for your time and attention! |
I merged #4546 that fully reverted #4540 (comment) |
@yassun7010 I would strongly advice against changing Though I understand the need for showing errors in this case, I just think by default there will be too many false positives. Just thinking out loud here, what if Tombi had a "strict" mode for Schema errors? In that case, it would "automatically set" |
@hyperupcall I had to work and did not have time to respond. I will accepts the strict mode suggestion. JSON Schema is a loose specification, There are probably many other similar schemas. Thanks 👍 |
Sorry, I hadn't much time to look into this but is there something from taplo side that could be improved? From the brief look into schema I haven't noticed any properties that weren't defined (but I also looked only via github diff UI which is terrible) |
After investigation, it is not a taplo problem. There was an actual case where a property (e.g. profile.dev.strip) was not defined in the JSON Schema of Cargo.toml, resulting in an error. This can be handled on the JSON Schema side. If there are improvements to be made on the taplo side, how about making errors only for properties that are not allowed, instead of listing the names of allowed properties in the error message? The GitHub diff of the JSON Schema for Tombi has a setting |
fix and update |
Fix: #4540 (comment)