Skip to content

Commit

Permalink
Set MIX_QUIET=1 when running mix format
Browse files Browse the repository at this point in the history
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
  • Loading branch information
andreasknoepfle committed Oct 14, 2024
1 parent d6f5207 commit 98f856d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ 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
* Improvements to formatter test framework, it is now possible to
write tests that have additional data files ([#301]).
Expand Down
2 changes: 1 addition & 1 deletion scripts/formatters/apheleia-mix-format
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ if [[ "${ver}" == "${higher_ver}" ]]; then
fi
args+=(-)

exec "${args[@]}"
MIX_QUIET=1 exec "${args[@]}"

0 comments on commit 98f856d

Please sign in to comment.