-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Lint front-matter, part 2 #26178
Lint front-matter, part 2 #26178
Conversation
OnkarRuikar
commented
Apr 13, 2023
- Continuing Lint front-matter using the work in progress fmlinter #26174
@@ -1,6 +1,6 @@ | |||
--- | |||
title: "Accelerometer: y property" | |||
short-title: y | |||
short-title: "y" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The js-yaml library is doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "y" and not "x"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, welcome to the world of YAML!
In YAML boolean value can be y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE |on|On|ON|off|Off|OFF
.[ref]
So short-title: y
is treated as short-title: true
, hence short-title: "y"
is technically correct. 🤓
How do you want to handle this? We can leave it as it is. Or in front matter schema define short-title
as string or boolean
type, this would be technically very wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha! That makes sense. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the many odd "y" (but no "x" 🤣 ), this looks ok.
38896f3
to
5d433a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Now that I know that y = true in YAML 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is why we really need a linter!
* Lint front-matter * Fix status array * Fix order and single char values