From f46d65c1790378b3038f8fdce04dc68e7f65672a Mon Sep 17 00:00:00 2001 From: Aleksandar Dimitrov Date: Sun, 3 Oct 2021 20:09:38 +0200 Subject: [PATCH] Fix rustfmt dumping child modules' content into file (#45) * Fix rustfmt dumping child modules' content into file rustfmt by default analyses all files dependent on the current file, too. The out put of --emit stdout contain all child modules. Apheleia would happily dump that into the currently edited buffer (even though the content came from another file.) The unstable option --skip-children prevents that. It's as yet untested! I've only made a couple of quick sanity checks. * Fix long line --- apheleia.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apheleia.el b/apheleia.el index 21872c9..0fcaf1c 100644 --- a/apheleia.el +++ b/apheleia.el @@ -466,7 +466,8 @@ modified from what is written to disk, then don't do anything." (latexindent . ("latexindent" file)) (ocamlformat . ("ocamlformat" file)) (prettier . (npx "prettier" "--stdin-filepath" filepath)) - (rustfmt . ("rustfmt" "--quiet" "--emit" "stdout" file)) + (rustfmt . ("rustfmt" "--unstable-features" "--skip-children" + "--quiet" "--emit" "stdout" file)) (terraform . ("terraform" "fmt" "-"))) "Alist of code formatting commands. The keys may be any symbols you want, and the values are