Jsonnet: No tab indent for `jsonnet fmt`

Created on 29 May 2018  路  2Comments  路  Source: google/jsonnet

Via jsonnet fmt command, it's possible to re-indent files with spaces and control the number of leading spaces with -n option. But it's not possible to re-indent via tabs.

wontfix

All 2 comments

Hard tabs are deliberately not supported since the formatter is opinionated. It will understand them and convert them, but not emit them. The amount of indentation is stored in the AST as an int representing the number of spaces. Supporting mixed or hard tab indentation would make that substantially more complicated. As a data point, YAML does not support tabs. My personal opinion is that hard tabs are bad because their width is non-standard and that makes it impossible to keep specific width limits.

That is sad to hear but I understand it. I wanted to mainly use it to reformat the file from the Vim editor, since the jsonnet syntax file does weird things. But me and my team also have preferred style (tabs) and we're reluctant to change that. I'm glad you left the issue open as I conclude that means you're open to apply patch that will let the other side of Tabs vs. Spaces war pick their style. :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

augi picture augi  路  7Comments

farcaller picture farcaller  路  4Comments

lihaoyi picture lihaoyi  路  6Comments

griff4692 picture griff4692  路  4Comments

mbrukman picture mbrukman  路  5Comments