# Shell formatting for this repo. # # Both `shfmt` and the Claude format hook (common/.config/claude/hooks/format.py, which only # runs shfmt/fish_indent where an .editorconfig opts in) read this file, so the policy and the # tool that enforces it live in one place. Neovim reads it natively too. # # The settings were picked to stay as close as possible to how these scripts were already # written by hand: 2-space indent, `case` arms indented under `case`, and `&&`/`||` starting # the wrapped line rather than trailing the one before it (binary_next_line, which reproduces # the existing `\` continuations exactly). shfmt still rewrites # a few things no option controls — one-line `case x) a; b ;;` arms and `{ a; b; }` guards # are split across lines, and `> file` loses its space — which is the one-time cost of # having a formatter own the layout instead of maintaining it by hand. # # `keep_padding` is deliberately NOT set: it is deprecated in shfmt, and it indents the # statements it splits by the padding column, producing a cascading staircase. # # Scoped to shell on purpose — there is no [*] section, so the repo's other filetypes are # untouched (a [*] block would retune all of them in any editorconfig-aware editor, and # would also switch on the hook's fish_indent for every fish file). root = true [{*.sh,dotsync,dotpub}] indent_style = space indent_size = 2 switch_case_indent = true binary_next_line = true