-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
fix(parser): Disallow CR in frontmatter #149823
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
base: main
Are you sure you want to change the base?
Conversation
T-lang came back on the stabilization PR asking for CR to be disallowed with the intention of preventing confusing situations where a stray CR looks like a line break. If need arises for it, this could always be turned into a lint at a later point.
|
Given that text-direction-codepoint-in-literal and text-direction-codepoint-in-comment are lints, I do think it makes sense for this and the similar error in raw strings to be a lint as well. I doubt that anyone is going to allow it, but I still think it makes sense to not be a hard error. That said, I don't think switching this from a hard error to a lint should be a blocker. Let's go ahead with the simple version of this change to unblock stabilization. |
|
@joshtriplett this only prevents the use of CR and not the text direction code points. However, this is making me more against doing CR in the first place if CR as an error is just a "simple version" of what we actually want. If these should be lints, they should be lints in the tool that owns processing the frontmatter. If we have them as lints in rustc, we then have both tools running those lints as they likely have a format outside of the frontmatter that should also lint and that would be generic code across the files. Having both lint can lead to a bad user experience including:
If we error on CR now and then remove it because tools should do it, that is a subtle change that could easily get lost in communicating back out to those tools. |
|
I've moved this to a draft until this is sorted out so we don't accidentally merge this |
|
r? me |
T-lang came back on the stabilization PR (#148051) asking for CR to be disallowed
with the intention of preventing confusing situations where a stray CR
looks like a line break.
If need arises for it, this could always be turned into a lint at a
later point.
Part of #136889