Repository navigation
docs: update description for brand typography "files" field - #12268
Conversation
cderv
left a comment
There was a problem hiding this comment.
Just a comment about this change as I don't think this is the best way to fix the problem reported.
Improving description is probably ok to do as this is simple for one field, but I don't think we should add in description how each fields need to be formatted. To me the schema is supposed to do that, and currently it does define it indeed with - <path> or path: <path>.
quarto-cli/src/resources/schema/definitions.yml
Lines 2923 to 2937 in 2ae62ed
It feels like the error from #12267 are the problem. They do not help on how to fix, and this is where it should be explained. I can see this also in linting error which is not clear enough regarding the expected shema,

I am not sure how to fix as I am not yet expert in how the schema work. I just want to be sure to focus on the underlying problem (uninformative and unhelpful error).
We have some other fields with similar schema (like filters) and the message is (slightly) clearer

So it seems the wrong type of error is thrown from validation. 🤔
I think it would be good to fix that.
|
I was not aware of the linting of the schema. I have added |
|
I agree with @cderv but I'm not sure how hard it would be to get a more specific/relevant error here. IIUC the YAML validator would need to see that you are trying to use quarto-cli/src/resources/schema/definitions.yml Lines 2811 to 2817 in 2ae62ed and saying that you haven't matched |
|
I was not referring to that Google error - I agree this one is trickier. They kind of behave the same or This is the error that this PR tries to mitigate by adding information about how to format in description directly |
|
Got it. I tried a few things but was not able to coax the validator to tell me that ... even though the schema is very similar to IDK but I am guessing the error is better on |
I came to the same conclusion too. We need to send the @cscheid signal ! |
|
One of these days I really should walk us all through the implementation of the yaml validator so that you understand the source that's causing these error message bugs. Yes, it's a bug. But before we start to fix it, I need to add support for testing against error messages in a way that we can include them in the test suite. I don't want to change things to fix the issue here, and then make it worse for other errors... |
I need clarification on this. My understanding is that this should already be possible, at least for smoke tests, and maybe not for I'm happy to tweak the tests suite to make what you have in mind happen. I made some improvements recently, so this is quite fresh to me. |
Sorry, I wasn't clear. I'd like to have a mode where Quarto emits its validation errors in a structured format (JSON) so that our verifiers don't need to work on regular expressions. This will require changing the validator code itself, but it will be an important feature for the future anyway. |
|
Revert |
|
Should I close and let you take over? |
|
I don’t think we have a clear plan for improving validation until 2.0. I continue to get bit by the underlying issue (esp with brand because it’s deeply nested) but I just tell myself that the errors don’t say quite what they mean; in this case it sounds like the key I’m inclined to take the patch but make the description shorter so it’s a hint and not duplicating the schema. I’ll take this. |
Say that files is a list, and leave the item shapes to the schema. Regenerate the build artifacts so editor tooling ships the new text.
be1a4d6 to
3516422
Compare
|
@gordonwoodhull I've rebased this on |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cderv
left a comment
There was a problem hiding this comment.
Thanks for the rebase. The short hint is what we discussed, it does not duplicate the schema anymore.
I regenerated the build artifacts on this branch and they match what you committed, so nothing else to rebuild before merge. LGTM.
Description
The
filesfield under brand typography now starts its description with "A list of font files to include."That hint shows in editor completion and hover.
If someone passes a single string, the validator says
property name files is invalid, and the hint tells themfilestakes a list.The item shapes stay in the schema and are not repeated in the text.
The build artifacts are regenerated, so
vs-code.mjsand the YAML intelligence resources ship the new text.Each generated file changes only in the
filesdescription.Related to #12267.
This does not fix the validator error message itself.
Checklist
I have (if applicable):
AI-assisted PR