From 84d9887a36f25bd9c5d760c7d7df376ead56962f Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sun, 6 Apr 2025 19:30:08 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-06 19:30:07 --- .config/fish/functions/justfmt.fish | 6 ++++++ .config/helix/config.toml | 1 + .config/helix/languages.toml | 3 ++- .config/helix/scripts/format_just.fish | 10 ++++------ .config/helix/scripts/testoutput | 26 ++++++++++++++++++++++++++ 5 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 .config/fish/functions/justfmt.fish diff --git a/.config/fish/functions/justfmt.fish b/.config/fish/functions/justfmt.fish new file mode 100644 index 00000000..b21622e0 --- /dev/null +++ b/.config/fish/functions/justfmt.fish @@ -0,0 +1,6 @@ +function justfmt --description "STDIO Justfile formatter" + set -l temp (mktemp) + cat >$temp + just --justfile $temp --dump + rm $temp +end diff --git a/.config/helix/config.toml b/.config/helix/config.toml index 7bcdb5ac..b0fb1aa7 100644 --- a/.config/helix/config.toml +++ b/.config/helix/config.toml @@ -7,6 +7,7 @@ default-yank-register = '+' cursorline = true bufferline = "multiple" color-modes = true +shell = ['fish', '-c'] mouse = true continue-comments = false diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml index 8416e5f8..3f08e718 100644 --- a/.config/helix/languages.toml +++ b/.config/helix/languages.toml @@ -278,6 +278,7 @@ injection-regex = "just" comment-token = "#" indent = { tab-width = 4, unit = " " } auto-format = false -formatter = { command = "just", args = ["--dump"] } # Please see: https://github.com/helix-editor/helix/issues/9703 +formatter = { command = "fish", args=["-c", "justfmt"] } +# formatter = { command = "just", args = ["--dump"] } # Please see: https://github.com/helix-editor/helix/issues/9703 language-servers = ["just-lsp", "scls"] diff --git a/.config/helix/scripts/format_just.fish b/.config/helix/scripts/format_just.fish index 17ba30a3..ab11a4d6 100755 --- a/.config/helix/scripts/format_just.fish +++ b/.config/helix/scripts/format_just.fish @@ -1,8 +1,6 @@ #!/usr/bin/env fish -# capture the input -# set -l temp (mktemp) -set -l input (cat -a) -echo $input >testoutput -# echo $input >$temp -# just --justfile $temp --dump +set -l temp (mktemp) +cat >$temp +just --justfile $temp --dump +rm $temp diff --git a/.config/helix/scripts/testoutput b/.config/helix/scripts/testoutput index 8b137891..6c4be5b7 100644 --- a/.config/helix/scripts/testoutput +++ b/.config/helix/scripts/testoutput @@ -1 +1,27 @@ +test: + #!/bin/sh + if command -v tparse >/dev/null 2>&1; then + set -o pipefail && go test ./... -json | tparse --all --smallscreen + else + go test ./... + fi + +commit: + git add . + git commit + +amend: + git add . + git commit --amend + +fmt: + go fmt ./... + +tools: + go install tool + +lint: + golangci-lint run + +check: fmt lint