I noticed that when I run a `meltano` command that...
# getting-started
m
I noticed that when I run a
meltano
command that updates
meltano.yml
, that it reformats the YAML. Can I turn that off? I’d prefer different indentation settings.
t
What version of meltano are you on? That should have been addressed in a version we released earlier this year
m
Copy code
$ meltano --version
meltano, version 2.10.0
installed today with
python -m pip install --upgrade meltano
on Python 3.9.11
t
oh you mention indentation settings - not order. hmm - @edgar_ramirez_mondragon I’m guessing Ruamel doesn’t respect user set indentation depths?
m
specifically, I would prefer:
Copy code
environments:
  - name: dev
and the CLI commands change this to
Copy code
environments:
- name: dev
t
I wonder if that’s a ruamel setting we can have folks set 🤔 would you mind filing an issue @Matt Menzenski? I suspect this behavior is currently “expected” but that’s not to say it’s ideal
m
sure thing - happy to try to contribute also
a
I'm not 100% sure if Ruamel is able to preserve/honor the user's preferred indentations. Would be good to confirm that. If we change the default, we'd have to think carefully on the best default experience and whether it is appropriate to make a one-time global change. Related SO answer
Logged issue would be much appreciated 🙏
e
Yup, Ruamel is conforming all indentations to
mapping=2, sequence=2, offset=0
by default. The preference above would mean having
mapping=2, sequence=4, offset=2
. That would be called globally here: https://github.com/meltano/meltano/blob/e51aa22626a6836306e5eb9d93544a826c3d439e/src/meltano/core/yaml.py#L17-L19 Ruamel docs: https://yaml.readthedocs.io/en/latest/detail.html#indentation-of-block-sequences
m