aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/mix.lua
diff options
context:
space:
mode:
authorEthan Gunderson <ethan@ethangunderson.com>2023-10-04 10:43:07 -0500
committerGitHub <noreply@github.com>2023-10-04 08:43:07 -0700
commit6836930ed5a0ec6e8bb531116c62cc10f475c298 (patch)
tree7a7a48d49904c83392136465985548ec610017df /lua/conform/formatters/mix.lua
parentb0d8519aa6fbaf4c259c9a9b6e7a734df9168968 (diff)
fix: support for mix format (#107)
* add support for mix format * split command and set cwd
Diffstat (limited to 'lua/conform/formatters/mix.lua')
-rw-r--r--lua/conform/formatters/mix.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/conform/formatters/mix.lua b/lua/conform/formatters/mix.lua
new file mode 100644
index 0000000..fb21db6
--- /dev/null
+++ b/lua/conform/formatters/mix.lua
@@ -0,0 +1,13 @@
+---@type conform.FileFormatterConfig
+return {
+ meta = {
+ url = "https://hexdocs.pm/mix/main/Mix.Tasks.Format.html",
+ description = "Format Elixir files using the mix format command.",
+ },
+ command = "mix",
+ args = { "format", "-" },
+ cwd = require("conform.util").root_file({
+ ".formatter.exs",
+ "mix.exs",
+ }),
+}