.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 <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2026-05-25 22:13:18 -07:00
parent 5f5c128abe
commit 6bd4f2141b

View file

@ -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