envd icon indicating copy to clipboard operation
envd copied to clipboard

feat(CLI): fmt command to reformat your configuration in the standard style

Open gaocegege opened this issue 2 years ago • 8 comments

Description

Support envd fmt command to reformat the configuration in the standard style

Reference - terraform

Usage: terraform [global options] fmt [options] [TARGET]

  Rewrites all Terraform configuration files to a canonical format. Both
  configuration files (.tf) and variables files (.tfvars) are updated.
  JSON files (.tf.json or .tfvars.json) are not modified.

  If TARGET is not specified, the command uses the current working directory.
  If TARGET is a file, the command only uses the specified file. If TARGET
  is "-" then the command reads from STDIN.

  The content must be in the Terraform language native syntax; JSON is not
  supported.

Options:

  -list=false    Don't list files whose formatting differs
                 (always disabled if using STDIN)

  -write=false   Don't write to source files
                 (always disabled if using STDIN or -check)

  -diff          Display diffs of formatting changes

  -check         Check if the input is formatted. Exit status will be 0 if all
                 input is properly formatted and non-zero otherwise.

  -no-color      If specified, output won't contain any color.

  -recursive     Also process files in subdirectories. By default, only the
                 given directory (or current directory) is processed.


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

gaocegege avatar Sep 15 '22 12:09 gaocegege

Already verified that black can be used to format/lint envd file.

Alternative:

kemingy avatar Sep 26 '22 12:09 kemingy

/assign @fengzixu

fengzixu avatar Oct 06 '22 00:10 fengzixu

:) Glad to check this issue, so assign it to myself first

fengzixu avatar Oct 06 '22 00:10 fengzixu

Thanks for your contribution! :tada: :+1:

gaocegege avatar Oct 06 '22 02:10 gaocegege

Feel free to ask if there is any question.

Our discord channel is here https://discord.gg/KqswhpVgdU

gaocegege avatar Oct 06 '22 02:10 gaocegege

Hi @fengzixu. It has been a while. Not sure if you're still working on this issue. Let us know if you need any help.

kemingy avatar Nov 10 '22 09:11 kemingy

@kemingy Sorry for reply late. I am little busy on the work recently. I plan to check it this weekend. But if it's urgent staff, it's ok to unassign it from me

fengzixu avatar Nov 10 '22 23:11 fengzixu

@kemingy Sorry for reply late. I am little busy on the work recently. I plan to check it this weekend. But if it's urgent staff, it's ok to unassign it from me

It's not urgent. Take your time.

kemingy avatar Nov 11 '22 00:11 kemingy