aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--apheleia-formatters.el2
-rw-r--r--test/formatters/installers/nomad.bash5
-rw-r--r--test/formatters/samplecode/nomad/in.nomad20
-rw-r--r--test/formatters/samplecode/nomad/out.nomad20
5 files changed, 49 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e0c6db9..c09323b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,8 @@ The format is based on [Keep a Changelog].
### Formatters
* Format Bazel files according to their type
+* `nomad fmt` official formatter for
+ [HashiCorp Nomad](https://developer.hashicorp.com/nomad) ([#361]).
[#299]: https://github.com/radian-software/apheleia/issues/299
diff --git a/apheleia-formatters.el b/apheleia-formatters.el
index 75374fa..c49c18e 100644
--- a/apheleia-formatters.el
+++ b/apheleia-formatters.el
@@ -104,6 +104,7 @@
(mix-format . ("apheleia-from-project-root"
".formatter.exs" "apheleia-mix-format" filepath))
(nixfmt . ("nixfmt"))
+ (nomad . ("nomad" "fmt" "-"))
(ocamlformat . ("ocamlformat" "-" "--name" filepath
"--enable-outside-detected-project"))
(ocp-indent . ("ocp-indent"))
@@ -370,6 +371,7 @@ rather than using this system."
(nasm-mode . asmfmt)
(nix-mode . nixfmt)
(nix-ts-mode . nixfmt)
+ (nomad-mode . nomad)
(perl-mode . perltidy)
(php-mode . phpcs)
(purescript-mode . purs-tidy)
diff --git a/test/formatters/installers/nomad.bash b/test/formatters/installers/nomad.bash
new file mode 100644
index 0000000..80215cc
--- /dev/null
+++ b/test/formatters/installers/nomad.bash
@@ -0,0 +1,5 @@
+curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
+echo "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/nomad.list
+
+apt-get update
+apt-get install -y nomad
diff --git a/test/formatters/samplecode/nomad/in.nomad b/test/formatters/samplecode/nomad/in.nomad
new file mode 100644
index 0000000..95cac05
--- /dev/null
+++ b/test/formatters/samplecode/nomad/in.nomad
@@ -0,0 +1,20 @@
+job "mongo-jwt" {
+ namespace = "default"
+
+ group "db" {
+ network {
+ port "db" {
+ static = 27017
+ }
+ }
+
+task "mongo" {
+driver = "docker"
+
+ config {
+ image = "mongo:7"
+ ports = ["db"]
+ }
+ }
+ }
+}
diff --git a/test/formatters/samplecode/nomad/out.nomad b/test/formatters/samplecode/nomad/out.nomad
new file mode 100644
index 0000000..3107f5b
--- /dev/null
+++ b/test/formatters/samplecode/nomad/out.nomad
@@ -0,0 +1,20 @@
+job "mongo-jwt" {
+ namespace = "default"
+
+ group "db" {
+ network {
+ port "db" {
+ static = 27017
+ }
+ }
+
+ task "mongo" {
+ driver = "docker"
+
+ config {
+ image = "mongo:7"
+ ports = ["db"]
+ }
+ }
+ }
+}