From de0df2422ac26edcd083d801e93635deb0786589 Mon Sep 17 00:00:00 2001 From: xieyonn Date: Sun, 21 Sep 2025 15:50:06 +0800 Subject: feat: add make fmt for *.sh *.bash 1. add .editorconfig file, add rules for .sh .bash files. 2. add make fmt target, use: - gofmt *.go. - shfmt *.sh *.bash, shell/completion.bash, shell/key-bindings.bash need a left indent due to an outermost if block. 3. add shfmt check for bash scripts in make lint target. 4. install shfmt in actions. --- .editorconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .editorconfig (limited to '.editorconfig') diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..15230cdb --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*.{sh,bash}] +indent_style = space +indent_size = 2 +simplify = true +binary_next_line = true +switch_case_indent = true +space_redirects = true +function_next_line = false + +# also bash scripts. +[{install,uninstall,bin/fzf-preview.sh,bin/fzf-tmux}] +indent_style = space +indent_size = 2 +simplify = true +binary_next_line = true +switch_case_indent = true +space_redirects = true +function_next_line = false -- cgit v1.2.3