Solved autoformatting for Justfiles #13287
-
TL;DR: Use a script to write Helix buffer to a temp file, use As seen in issue #9703 , there's an issue with formatting the I wrote a Fish script to work around this. Basic idea is to write function justfmt --description "STDIO Justfile formatter"
set -l temp (mktemp)
cat >$temp
just --justfile $temp --dump
rm $temp
end Then in [[language]]
name = "just"
auto-format = true
formatter = { command = "fish", args=["-c", "justfmt"] } Here's an example of a Bash script that does the same: #!/bin/sh
TEMP="$(mktemp)"
cat > "$TEMP"
just --justfile "$TEMP" --dump
rm "$TEMP" |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Does |
Beta Was this translation helpful? Give feedback.
-
I also write a rust wrapper to do this: https://github.com/eli-yip/just-formatter |
Beta Was this translation helpful? Give feedback.
I also write a rust wrapper to do this: https://github.com/eli-yip/just-formatter