Skip to content

Apheleia 3.1

Compare
Choose a tag to compare
@raxod502 raxod502 released this 12 Nov 03:53
· 139 commits to main since this release

Enhancements

  • shfmt uses 4 spaces instead of tabs by default.
  • Formatters using 'filepath (OCamlFormat and Prettier) are no longer prevented from running on a modified buffer (#109, #110).
  • Buffer content is now always passed to formatters using a pipe. This fixes issues with formatters that behave differently when receiving input on stdin versus being run on a tty (#119).
  • Prettier now specifies --parser argument explicitly, so it will work properly even when the name of the file does not match what Prettier expects (e.g. .yamllint will be formatted as YAML by Prettier as long as it is in yaml-mode). See #103.

Bugs fixed

  • When a formatter has a bug and fails to return anything on stdout (e.g. scalafmt), do not erase the buffer (#116).
  • Fix Error: "Selecting deleted buffer" which occurred in some circumstances due to a race condition (#123).
  • Apheleia does not delete the contents of narrowed buffers when running. Instead, it is disabled in narrowed buffers. Support for narrowed buffers may be added in future but it has never been correctly supported in the past (see #43). More at #124, #127.
  • Currently, when a formatter invoked via a process isn't installed correctly; it throws an error. It doesn't make sense to attempt to format if we can't find the correct formatter, so instead formatting is only attempted when the formatter is found. #126
  • clang-format doesn't handle filenames correctly by default. Support for guessing the flags from first the file name then the major mode in the case of a temporary buffer was added in #128
  • Fix handling of formatters using inplace in some circumstances (#132).

Formatters

  • elm-format for Elm (#100).
  • bean-format for Beancount (#101).
  • stylua for Lua (#105).
  • Native Emacs indentation of Emacs Lisp code as a formatter (#102). This is not enabled by default but you can enable it by adding (emacs-lisp-mode . lisp-indent) to apheleia-mode-alist

Bugfixes

  • Prettier supports SCSS instead of SASS. The original support for SASS in Apheleia was a bug because Prettier actually never had support for SASS in the first place, so Apheleia would have failed anyway on trying to format a SASS file.