diff --git a/CHANGELOG.md b/CHANGELOG.md index f979fcb..9e60b7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,9 +22,12 @@ The format is based on [Keep a Changelog]. [awk](https://en.wikipedia.org/wiki/AWK) ([#187]). * [`asmfmt`](https://github.com/klauspost/asmfmt) for assembly ([#168]). * [`astyle`](https://github.com/steinwurf/astyle) for C ([#169]). +* [`beautysh`](https://github.com/lovesegfault/beautysh) for shell + scripts ([#170]) [#168]: https://github.com/radian-software/apheleia/pull/168 [#169]: https://github.com/radian-software/apheleia/pull/169 +[#170]: https://github.com/radian-software/apheleia/pull/170 [#174]: https://github.com/radian-software/apheleia/pull/174 [#182]: https://github.com/radian-software/apheleia/pull/182 [#187]: https://github.com/radian-software/apheleia/pull/187 diff --git a/apheleia.el b/apheleia.el index 66a4025..fd3ec09 100644 --- a/apheleia.el +++ b/apheleia.el @@ -36,6 +36,10 @@ "--options" ".astylerc"))) (asmfmt . ("asmfmt")) (bean-format . ("bean-format")) + (beautysh . ("beautysh" + (apheleia-formatters-indent + "--tab" "--indent-size" 'sh-basic-offset) + "-")) (black . ("black" (when (apheleia-formatters-extension-p "pyi") "--pyi") (apheleia-formatters-fill-column "--line-length") diff --git a/test/formatters/installers/beautysh.bash b/test/formatters/installers/beautysh.bash new file mode 100644 index 0000000..6378c80 --- /dev/null +++ b/test/formatters/installers/beautysh.bash @@ -0,0 +1,2 @@ +apt-get install -y python3-pip +pip3 install beautysh diff --git a/test/formatters/samplecode/beautysh/in.bash b/test/formatters/samplecode/beautysh/in.bash new file mode 120000 index 0000000..574ddb3 --- /dev/null +++ b/test/formatters/samplecode/beautysh/in.bash @@ -0,0 +1 @@ +../shfmt/in.bash \ No newline at end of file diff --git a/test/formatters/samplecode/beautysh/out.bash b/test/formatters/samplecode/beautysh/out.bash new file mode 100644 index 0000000..cfdcce7 --- /dev/null +++ b/test/formatters/samplecode/beautysh/out.bash @@ -0,0 +1,2 @@ +function f(){ +thing;}