diff options
| author | Radon Rosborough <radon@beeper.com> | 2026-04-14 15:38:43 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-14 15:38:43 -0700 |
| commit | 14316996958ec8962d9395bc4d986411f77971de (patch) | |
| tree | fcc6a4032e75415f7ed84cf55b21ee931e26c5a7 /test/formatters | |
| parent | e6e5d5523d229735ab5f8ec83e10beefcfd00d76 (diff) | |
Add OpenTofu, use by default for Terraform (#391)
Seems fairly straightforward to me, Terraform is no longer open-source,
OpenTofu is the compatible open-source successor, similar to the
Redis/Valkey situation.
Of course, if someone still prefers to use Terraform instead, they can
easily customize using:
```tf
(setf (alist-get 'terraform-mode apheleia-mode-alist) 'terraform)
```
We don't have a mechanism for allowing multiple formatters to be
registered for the same major mode, where later ones could be used if
earlier ones are not installed. That might be a nice addition.
Diffstat (limited to 'test/formatters')
| -rw-r--r-- | test/formatters/installers/opentofu.bash | 7 | ||||
| -rw-r--r-- | test/formatters/samplecode/opentofu/in.tf | 6 | ||||
| -rw-r--r-- | test/formatters/samplecode/opentofu/out.tf | 6 |
3 files changed, 19 insertions, 0 deletions
diff --git a/test/formatters/installers/opentofu.bash b/test/formatters/installers/opentofu.bash new file mode 100644 index 0000000..d95c0fe --- /dev/null +++ b/test/formatters/installers/opentofu.bash @@ -0,0 +1,7 @@ +curl -fsSL https://get.opentofu.org/opentofu.gpg -o /etc/apt/keyrings/opentofu.gpg +curl -fsSL https://packages.opentofu.org/opentofu/tofu/gpgkey | gpg --no-tty --batch --dearmor -o /etc/apt/keyrings/opentofu-repo.gpg + +echo "deb [signed-by=/etc/apt/keyrings/opentofu.gpg,/etc/apt/keyrings/opentofu-repo.gpg] https://packages.opentofu.org/opentofu/tofu/any/ any main" > /etc/apt/sources.list.d/opentofu.list + +apt-get update +apt-get install -y tofu diff --git a/test/formatters/samplecode/opentofu/in.tf b/test/formatters/samplecode/opentofu/in.tf new file mode 100644 index 0000000..7fd0456 --- /dev/null +++ b/test/formatters/samplecode/opentofu/in.tf @@ -0,0 +1,6 @@ + resource "google_sql_user" "user" { + name = "camunda" + instance =google_sql_database_instance.camunda-db.name + + password ="futurice" + } diff --git a/test/formatters/samplecode/opentofu/out.tf b/test/formatters/samplecode/opentofu/out.tf new file mode 100644 index 0000000..ca64220 --- /dev/null +++ b/test/formatters/samplecode/opentofu/out.tf @@ -0,0 +1,6 @@ +resource "google_sql_user" "user" { + name = "camunda" + instance = google_sql_database_instance.camunda-db.name + + password = "futurice" +} |
