question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: New "Format yaml array sections" toggle puts single Date value into array

See original GitHub issue

Describe the Bug

With the new “Format YAML Array” and “Format yaml array sections” rules, a single non-array date value in the YAML is getting converted into an array. I do not understand why!

How to Reproduce

In “Settings” -> “Linter” turn on the first toggle under “Format YAML Array” and the “Format yaml array sections” toggle. Run the linter on the following:

---
date: 2022-08-14
tags: []
---

Result is:

---
date: [2022-08-14]
tags: []
---

This breaks all my dataview queries that use the date field, since they expect it to be a Date and not an array.

Expected Behavior

No changes made by linter. Expected output:

---
date: 2022-08-14
tags: []
---

Device

  • Desktop

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
pjkaufmancommented, Aug 15, 2022

I have a fix for this. It will hopefully go out in a release soon. I would like to be able to release it with another bug fix if possible to avoid making a release for just one bug fix however I may end up releasing it today anyways as it is a bug fix for a new rule.

1reaction
pjkaufmancommented, Aug 15, 2022

I did manage to find another bug which was reported by someone else. I will merge it in and plan to release this evening. Hopefully this will make it so bugs are kept to a minimum and get addressed more quickly while allowing time to add FRs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to escape indicator characters (colon and hyphen) in YAML
A pipe preserves newlines, a gt-sign turns all the following lines into one long string. Share.
Read more >
defining dates in array elements giving error - ServiceNow
Solved: Hi Friends , Below i am trying to fetch some changes and update those actual start and end dates using arrays. But...
Read more >
Variables in YAML pipeline are not allowing to define array
I need to be able to enter e.g. array of values like "servername","tenant","environmentname" to be able to deploy to multiple environments... Is this...
Read more >
Python and TOML: New Best Friends - Real Python
Values have types. In this example, the value is a text string. You'll learn about the different value types in the following subsections....
Read more >
Swagger RESTful API Documentation Specification
This object is used to describe the value types used inside an array. Of the Data Type Fields, it can include either the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found