diff options
| author | Tej Chajed <tchajed@gmail.com> | 2025-12-01 17:48:16 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-01 15:48:16 -0800 |
| commit | 35ebd1b65291483fded1cb939cccfe28c9116782 (patch) | |
| tree | 6e2e408b4ad76421c105aefe3fd194fb895df3da /apheleia-formatters.el | |
| parent | 436cd94b3e01c8c4314645417ce40b1acdb5d2cb (diff) | |
Fix shfmt when used with apheleia-formatters-respect-indent-level (#379)
The shfmt formatter produced an invalid command invocation. The symptom
was an error: `eval: Invalid function: "-i"`
I couldn't figure out how to splice the list in correctly but
`--indent=` can be passed as one argument.
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
Diffstat (limited to 'apheleia-formatters.el')
| -rw-r--r-- | apheleia-formatters.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apheleia-formatters.el b/apheleia-formatters.el index 928dcbb..0cf5a93 100644 --- a/apheleia-formatters.el +++ b/apheleia-formatters.el @@ -206,13 +206,13 @@ (sh "posix") (t "bash")) (when apheleia-formatters-respect-indent-level - (list - "-i" (number-to-string - (cond - (indent-tabs-mode 0) - ((boundp 'sh-basic-offset) - sh-basic-offset) - (t 4))))) + (format + "--indent=%d" + (cond + (indent-tabs-mode 0) + ((boundp 'sh-basic-offset) + sh-basic-offset) + (t 4)))) "-")) (rufo . ("rufo" "--filename" filepath "--simple-exit")) (stylua . ("stylua" "-")) |
