pulumi icon indicating copy to clipboard operation
pulumi copied to clipboard

`pulumi config format`

Open blampe opened this issue 3 years ago • 3 comments

Pulumi (very helpfully) auto-formats its yaml files after running a command like pulumi config set ....

Occasionally people will manually modify their Pulumi config files, which inevitably introduces drift from Pulumi's formatting. That drift adds up until someone runs pulumi config ... again, but now their PR includes a bunch of unwanted formatting changes.

It would be helpful to expose an auto formatter for Pulumi config files, similar to tools like gofmt, so teams can keep changes free from formatting noise.

Something like: pulumi config format -s stack?

blampe avatar Mar 11 '23 07:03 blampe

I've got the very same problem as @blampe and was also about to suggest pulumi config format -s stack.

I tried to lint my files with pulumi config refresh --force -s stack -c directory but it requires to have credentials to connect to each actual stacks. This makes it quite an endeavour as I have to manage credentials just to lint, rendering it almost impossible in a local setup.

LouisJULIEN avatar Apr 27 '23 13:04 LouisJULIEN

I'd also love to have a feature like that. As a workaround, I am going to go with set and then rm

pulumi config set temp 1
pulumi config rm temp

Obi-Dann avatar Nov 16 '23 04:11 Obi-Dann

+1, would really useful, even this formating/sorting function already exists that shouldn't be hard just to move it as separate cli option

oleksandr-kinship avatar Oct 15 '24 12:10 oleksandr-kinship