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.

Enable configurable indentation

See original GitHub issue

e.g.

foo.json

{
  "test": {
    "s1": "bar",
    "s2": [
      "snowflake",
      "s3",
      "gcloud"
    ]
  }
}

yq -y . foo.json

test:
  s1: bar
  s2:
  - snowflake
  - s3
  - gcloud

When valid yaml should be:

 test:
   s1: bar
   s2:
     - snowflake
     - s3
     - gcloud

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
kislyukcommented, Oct 25, 2019

I have found a way to address this issue. By default, yq -y will now indent block lists by 2 spaces ( - item instead of - item). The old behavior (0 spaces, the PyYAML default) can be triggered via yq -y --indentless-lists.

Released in v2.8.0, please test.

0reactions
ghostcommented, Oct 26, 2019

@kislyuk it’s working for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Indentation | IntelliJ IDEA Documentation - JetBrains
Open indentation settings in code style scheme. Click the widget and select Configure Indents for 'Language'. Configure Indents for Java.
Read more >
Use a screen reader to change the indentation and spacing ...
To set the indentation size, press the Tab key. You hear "By" and the current indentation size. Then type the value in inches,...
Read more >
How to Change Tabs to Space, Auto Indent, Code Folding Lines
TIMESTAMP 0:00 Notepad++ Indentation Settings 1:23 How To Configure Indentation Settings? (Convert Tabs to Spaces) 6:19 How To Auto- Indent ...
Read more >
How to change indentation mode in Atom? - Stack Overflow
I use the auto-detect-indentation plugin, which not only will automatically configure the tab key to do whatever is already in the file, but...
Read more >
ocp-indent - Automatic indentation of OCaml source files
-c CONFIG, --config=CONFIG Configure the indentation parameters. See section CONFIGURATION for more information. -d, --debug Enable debug output to stderr.
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