Skip to content

Apheleia 2.0

Compare
Choose a tag to compare
@raxod502 raxod502 released this 10 Apr 20:55

Breaking changes

  • The interface to apheleia-format-buffer has changed. You now pass in the symbol of a formatter from apheleia-formatters (or a list of them) rather than the actual command. This change improves the ability of Apheleia to report useful error messages and logging.
  • Stdout and stderr buffers are no longer retained after running a formatter. Instead, the stderr is appended into an *apheleia-cmdname-log* buffer if it fails, or unconditionally if the new user option apheleia-log-only-errors is set to nil. See #64, #65. The log buffer is not hidden by default, unlike the old stdout and stderr buffers, but this can be changed with the new user option apheleia-hide-log-buffers. Also, the log shows all command output rather than just the latest run. You can add further customizations using the new hook apheleia-formatter-exited-hook (#69).

Features

  • Apheleia can now format buffers that do not have an underlying file (#52).
  • You can now use a Lisp function as a formatter, by providing a symbol or lambda in apheleia-formatters rather than a list of strings (#62).
  • Formatters that operate on files in place are now supported, by using the symbol inplace in an entry on apheleia-formatters to stand in for the name of a temporary file that will be modified in place by the formatter (#23).

Enhancements

  • The buffer-local variable apheleia-formatter is now marked as safe (#74). This allows you to configure the formatter that Apheleia will use in a file-local variable. Note: only formatters already declared in apheleia-formatters can be used; this does not allow arbitrary shell commands to be specified in file-local variables.

Bugs fixed

  • Allow running the same formatter in multiple buffers in parallel (#64, #65). Previously, when saving a number of files at the same time, the contents of those buffers could be corrupted by a race condition.
  • In some circumstances the error wrong-type-argument bufferp nil could be reported when running certain formatters under Apheleia. This has been fixed.
  • Rustfmt is no longer passed the --unstable-features and --skip-children flags, since they are not available on all versions of Rustfmt (#69).
  • When a formatter cannot be found, orphaned stderr processes are no longer created and left around forever (#47).
  • Apheleia no longer resets the major mode to its default value when formatting a buffer. This was never intended and the bug has now been fixed (#58).

Formatters added

Formatter bugs fixed

  • isort is passed different arguments so as not to trigger a crash that appears to be related to the --stdout flag.
  • latexindent now has its log file disabled so as to avoid cluttering the working directory.
  • ocamlformat is now configured to work even outside of detected projects.