From 6bd4f2141bfad2c9ae4117d230a0ac50a5f650a4 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 25 May 2026 22:13:18 -0700 Subject: [PATCH] .editorconfig: add [[shell]] section, space_redirects 1. Add [[shell]] section, which is for shfmt only to apply formatting to shell files that does not end with .sh or bash, but with a shebang line present. 2. Add space_redirects = true setting for shfmt. Note the [[language]] syntax is not officially supported by editorconfig standard (the discussion since at least 2019 is still ongoing, see [1]) but is supported by shfmt since v3.8.0 (February 2024). [1]: https://github.com/editorconfig/editorconfig/issues/404 Signed-off-by: Kir Kolyshkin --- .editorconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.editorconfig b/.editorconfig index 5e4fc7919c..7d716a6808 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,12 @@ ignore = true [*.{bash,bats,sh}] indent_style = space indent_size = 4 +space_redirects = true + +# This is for shell scripts with shebang but no extensions. +# Not yes supported by editorconfig[1], only by shfmt. +# https://github.com/editorconfig/editorconfig/issues/404 +[[shell]] +indent_style = space +indent_size = 4 +space_redirects = true