aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Knöpfle <andreas.knoepfle@gmail.com>2024-10-18 01:34:42 +0200
committerGitHub <noreply@github.com>2024-10-17 23:34:42 +0000
commit4e00c9ce49ed7a854f34677ffccb24ddbcf7e469 (patch)
tree249fe5ec4ca57489ccea044b7787b7e7655587da
parent568ad0154d4ff07bdded17b404fb6b2086afd235 (diff)
Set MIX_QUIET=1 when running mix format (#326)
With the current way of passing things to aphelia, sometimes compilation output gets added to the top of the formatted file. This is because `mix format -` will actually still use [`Mix.Shell.info/1`](https://hexdocs.pm/mix/1.17.3/Mix.Shell.html#c:info/1) to output thing like: ``` ==> module Compiling 56 files (.ex) ``` However `info` messages can be silenced when setting `MIX_QUIET`. Docs: https://hexdocs.pm/mix/1.17.3/Mix.html#module-environment-variables --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
-rw-r--r--CHANGELOG.md3
-rwxr-xr-xscripts/formatters/apheleia-mix-format2
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 40e6d5c..1260fcc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,8 @@ The format is based on [Keep a Changelog].
* `mix format` is now passed the `--stdin-filename` argument which is
required in some cases. The version of Mix is autodetected and this
option is only passed when it is supported ([#319]).
+* `mix format` is now run with `MIX_QUIET` to supress compilation
+ output ([#326])
* Beancount files are formatted without an error ([#309]).
## Internal
@@ -49,6 +51,7 @@ The format is based on [Keep a Changelog].
[#316]: https://github.com/radian-software/apheleia/pull/316
[#317]: https://github.com/radian-software/apheleia/issues/317
[#319]: https://github.com/radian-software/apheleia/pull/319
+[#326]: https://github.com/radian-software/apheleia/pull/326
[#327]: https://github.com/radian-software/apheleia/pull/327
## 4.2 (released 2024-08-03)
diff --git a/scripts/formatters/apheleia-mix-format b/scripts/formatters/apheleia-mix-format
index a93bea0..21531d7 100755
--- a/scripts/formatters/apheleia-mix-format
+++ b/scripts/formatters/apheleia-mix-format
@@ -32,4 +32,4 @@ if [[ "${ver}" == "${higher_ver}" ]]; then
fi
args+=(-)
-exec "${args[@]}"
+MIX_QUIET=1 exec "${args[@]}"