You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,26 @@ This process is idempotent: running the tool multiple times yields the same resu
13
13
14
14
## Supported Blocks
15
15
16
-
`hclalign`currently aligns attributes inside Terraform `variable` blocks. Other block types are left untouched.
16
+
`hclalign` aligns attributes inside Terraform blocks including `variable`, `output`, `locals`, `module`, `provider`, `terraform`, `resource`, `data`, `dynamic`, `lifecycle`, and `provisioner`.
17
17
18
18
## Schema Options
19
19
20
20
The default schema orders variable attributes as `description`, `type`, `default`, `sensitive`, `nullable`. Override it with `--order` and enforce that only those attributes appear by adding `--strict-order`.
21
21
22
+
## Formatting Strategies
23
+
24
+
The fmt phase supports multiple strategies controlled by `--fmt-strategy`:
25
+
`auto` chooses the Terraform binary if available, `binary` always shells out to
26
+
`terraform fmt`, and `go` uses the built-in formatter. Use `--fmt-only` to stop
27
+
after formatting or `--no-fmt` to skip this phase.
28
+
29
+
## Provider Schema Integration
30
+
31
+
Resource and data blocks can be ordered according to provider schemas. Supply a
32
+
schema file via `--providers-schema` or let `hclalign` invoke `terraform
33
+
providers schema -json` by passing `--use-terraform-schema`. Unknown attributes
34
+
fall back to alphabetical order.
35
+
22
36
## CLI Flags
23
37
24
38
-`--write` (default): rewrite files in place
@@ -27,9 +41,14 @@ The default schema orders variable attributes as `description`, `type`, `default
27
41
-`--stdin`, `--stdout`: read from stdin and/or write to stdout
28
42
-`--include`, `--exclude`: glob patterns controlling which files are processed
29
43
-`--follow-symlinks`: traverse symbolic links
30
-
-`--order`, `--strict-order`: control and enforce schema ordering
44
+
-`--order`, `--strict-order`: control schema ordering; `--strict-order` applies globally to all blocks
31
45
-`--concurrency`: maximum parallel file processing
0 commit comments