Dhall-haskell: [dhall-to-yaml-ng] Add the ability to put a comment at the top of the yaml file indicating it's a generated file

Created on 4 Jun 2020  路  5Comments  路  Source: dhall-lang/dhall-haskell

We use dhall to generate yaml configs and it'd be nice to have the ability for dhall-to-yaml-ng to insert a comment at the top of the generated yaml indicating that this config should not be manually alerted.

In case anyone wonders why do we check in the generated yaml at all, we use dhall to generate gitlab-ci.yml file, which is read by gitlab. We have to check this file in.

Thanks,

Most helpful comment

I have a fix up here: https://github.com/dhall-lang/dhall-haskell/pull/1840

I ended up using --no-edit for the flag name to keep it short, but I'm open to other names, too

All 5 comments

Sounds great. It could be a cli option (--generated-comment?) that on/off this feature, off by default.

It would be a feature only for yaml I guess, json doesn't supports comments. If this is done, it should be on dhall-to-yaml[-ng]

I have a fix up here: https://github.com/dhall-lang/dhall-haskell/pull/1840

I ended up using --no-edit for the flag name to keep it short, but I'm open to other names, too

FWIW if I read --no-edit without context I won't know what this is about. --no-edit-comment is long but at least I would still know what it does in a few months without reading the description.

Thanks @Gabriel439 for the quick PR. Echoing what @PierreR said, maybe a more descriptive command-line flag is called for, and maybe provide a single letter shortcut?

I ended up going with --generated-comment like @german1608 suggested

@kevinjqiu: I usually try to avoid single-letter flags so that command lines are easier for others to understand

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DrSensor picture DrSensor  路  6Comments

Profpatsch picture Profpatsch  路  4Comments

michalrus picture michalrus  路  6Comments

SiriusStarr picture SiriusStarr  路  5Comments

Gabriel439 picture Gabriel439  路  6Comments