terrafmt

command module
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2020 License: MPL-2.0 Imports: 11 Imported by: 0

README

Terraform formatting tool

So terraform fmt doesn't give you any options at all, for example indent space count so made this for those whos formatting opinions differ from Hashicorp's :D

Running terrafmt without any args will format files in the current directory, it has --check and --diff for source validation in CI.

terrafmt --help
Usage: terrafmt [<path> ...]

Formats terraform files. If no path is specified, the current working directory is used.

Arguments:
  [<path> ...]    Paths or files to format

Flags:
      --help                         Show context-sensitive help.
      --indent-length=2              Indent size in spaces
      --recursive                    Search recurively for .tf files
      --check                        Check files dont require modification, returns 0 when no changes are required, 1 when changes are needed
      --diff                         Dont modify files but show diff of the changes
  -V, --version                      Displays version
      --line-up-assignment-blocks    Line up blocks of assignments
      --line-up-comment-blocks       Line up blocks of comments

TODO

  • Make diff output like diff -u
  • Fix bug when searching for files (must be a better way to do this)
  • Sign and notarize mac binaries as Catalina gets unhappy

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL