apheleia/CHANGELOG.md

345 lines
15 KiB
Markdown
Raw Normal View History

2019-09-20 17:08:09 -07:00
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog].
2022-06-04 15:37:45 -07:00
## Unreleased
### Features
* You can use `apheleia-inhibit` as a file-local variable to disable
Apheleia turning on automatically for a file or directory. You can
also use `apheleia-inhibit-functions` to configure custom logic to
prevent Apheleia from turning on automatically under certain
circumstances, without needing to adjust file-local variables. See
[#134] and [#138].
* `apheleia-mode` lighter is now customizable ([#143]).
### Enhancements
* Emacs 29's tree-sitter-based major modes have been added to
`apheleia-mode-alist` ([#145]).
2022-11-11 19:50:56 -08:00
### Bugs fixed
* If a formatter exited with a zero exit code when being killed by a
signal (even though that is really weird behavior and arguably a bug
in the formatter), then if a file was saved multiple times in quick
succession, its contents could be erased and replaced with an error
message from the formatter. This has been fixed. See [#131] for more
details.
### Formatters
* [`crystal tool
format`](https://crystal-lang.org/reference/1.6/man/crystal/index.html#crystal-tool-format)
for [Crystal](https://crystal-lang.org/) ([#137]).
* [gofumpt](https://pkg.go.dev/mvdan.cc/gofumpt) and
[goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports) for
[Go](https://golang.google.cn/) ([#147]).
2022-11-11 19:50:56 -08:00
[#131]: https://github.com/radian-software/apheleia/issues/131
[#134]: https://github.com/radian-software/apheleia/issues/134
[#137]: https://github.com/radian-software/apheleia/pull/137
[#138]: https://github.com/radian-software/apheleia/pull/138
[#143]: https://github.com/radian-software/apheleia/pull/143
[#145]: https://github.com/radian-software/apheleia/pull/145
[#147]: https://github.com/radian-software/apheleia/pull/147
2022-11-11 19:50:56 -08:00
2022-11-11 19:47:03 -08:00
## 3.1 (released 2022-11-11)
2022-06-04 15:37:45 -07:00
### 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].
2022-06-04 15:37:45 -07:00
### 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]).
2022-06-21 06:21:27 +09:00
### Formatters
* [elm-format](https://github.com/avh4/elm-format) for Elm ([#100]).
* [bean-format](https://github.com/beancount/beancount) for Beancount
([#101]).
2022-06-21 06:21:27 +09:00
* [stylua](https://github.com/JohnnyMorganz/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`
2022-06-21 06:21:27 +09:00
### 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.
[#43]: https://github.com/radian-software/apheleia/issues/43
[#100]: https://github.com/radian-software/apheleia/pull/100
[#101]: https://github.com/radian-software/apheleia/pull/101
[#102]: https://github.com/radian-software/apheleia/pull/102
[#103]: https://github.com/radian-software/apheleia/issues/103
[#105]: https://github.com/radian-software/apheleia/pull/105
[#109]: https://github.com/radian-software/apheleia/issues/109
[#110]: https://github.com/radian-software/apheleia/pull/110
[#116]: https://github.com/radian-software/apheleia/pull/116
[#119]: https://github.com/radian-software/apheleia/pull/119
[#123]: https://github.com/radian-software/apheleia/issues/123
[#124]: https://github.com/radian-software/apheleia/issues/124
[#125]: https://github.com/radian-software/apheleia/pull/125
[#126]: https://github.com/radian-software/apheleia/pull/126
[#127]: https://github.com/radian-software/apheleia/pull/127
[#128]: https://github.com/radian-software/apheleia/pull/128
[#132]: https://github.com/radian-software/apheleia/pull/132
2022-06-21 06:21:27 +09:00
2022-06-01 09:58:10 -07:00
## 3.0 (released 2022-06-01)
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
### Breaking changes
* The arguments of formatters defined as Elisp functions has changed.
A formatter function should now be a `cl-defun` taking key-value
arguments with support for more keys being provided on a later
apheleia release (by including `&allow-other-keys` in the parameter
list). For a list of provided arguments see
`apheleia--run-formatter-function`.
* Emacs 25 is no longer supported.
### Enhancements
* Ocamlformat is now used in `caml-mode` in addition to `tuareg-mode`
([#94]).
### Formatters
* [dart-format](https://dart.dev/tools/dart-format) for Dart ([#89]).
* [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for PHP
([#87]).
* [ktlint](https://github.com/pinterest/ktlint) for Kotlin ([#97]).
* [nixfmt](https://github.com/serokell/nixfmt) for Nix ([#98]).
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
### Features
* Support remote files and buffers that were opened through TRAMP
([#33]).
2022-06-20 14:51:38 -07:00
[#33]: https://github.com/radian-software/apheleia/issues/33
[#87]: https://github.com/radian-software/apheleia/pull/87
[#89]: https://github.com/radian-software/apheleia/pull/89
[#94]: https://github.com/radian-software/apheleia/pull/94
[#97]: https://github.com/radian-software/apheleia/pull/97
[#98]: https://github.com/radian-software/apheleia/pull/98
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
2022-06-01 09:58:10 -07:00
## 2.0 (released 2022-04-10)
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
### 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.
2022-01-02 16:41:20 -08:00
* 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]).
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
### 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
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
strings ([#62]). The function should be a `cl-defun` taking key-value
arguments with support for more keys being provided on a later
apheleia release (by including `&allow-other-keys` in the parameter
list). For a list of provided arguments see
`apheleia--run-formatter-function`.
2022-01-04 16:21:10 -08:00
* 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]).
2022-01-02 16:41:20 -08:00
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
### 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.
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
### Bugs fixed
2021-12-27 20:21:56 -08:00
* 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.
2022-01-02 16:41:20 -08:00
* Rustfmt is no longer passed the `--unstable-features` and
`--skip-children` flags, since they are not available on all
versions of Rustfmt ([#69]).
2022-01-04 16:08:04 -08:00
* 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]).
2021-12-27 20:21:56 -08:00
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
### Formatters added
2022-01-11 21:14:17 -08:00
* [fish\_indent](https://fishshell.com/docs/current/cmds/fish_indent.html)
for [Fish](https://fishshell.com/) ([#68]).
Support formatting remote files with Tramp (#76) * [#33] Support remote buffers and files CLOSES #33 Adds support for formatting remote files. The new `apheleia-remote-algorithm` option configures this. The default behaviour is consistent with what we had before, with `apheleia` aborting a formatting when dealing with a remote file/buffer. Users can customise apheleia to run the formatter on the remote machine, in which case any temporary files or other checks such as `npx` will be fully handled on the remote machine. Users can also make apheleia run the formatter on the local machine. This works exactly like one would expect, except if the formatter requires access to the physical file (meaning it uses 'file in `apheleia-formatters`) because the file isn't available on the local machine. This PR also fixes a bug in apheleia where `input-fname` was assigned in local let scope, instead of being returned by `apheleia--format-command`, meaning any formatters using a 'input file weren't cleaned up after formatting. * Cleanup + run diffs on remote as well * Fix diff uses correct file path for remote files If a file being diffed is remote, but the program is being run locally, then we create a temporary file on the current machine. * Make a few style changes * Drop support for Emacs 25 * Fix GitHub Actions triggers * Don't run tests on Emacs 25 either * Make apheleia run synchronously when running on remote Also added a metadata field to function based formatters. * feat: Suppress meaningless messages while formatting synchronously Also fixed any linter complaints. * bug: Make running formatter locally on remote buffer synchronous More re-entrant tramp issues. * Update apheleia.el * review: Replace custom temp-file logic with make-nearby-temp-file * review: Revamp functional formatter interface * refactor: Rework remote file handling implementation + Reordered parameters to ensure remote always comes before callback. + Updated some docstrings. * bug: Re-add apheleia--make-temp-file We don't always want to create a temporary file on the remote, only when apheleia-remote-algorithm is 'remote. * bug: Prevent repeat diff-file invocation with 2 files Previously we always made a temp-file for diffing the formatted and unformatted buffer leading to a bug when trying to send stdin to the formatter process. Now we only perform this check when running both locally and remotely. * Update changelog Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-04-10 22:21:50 +01:00
### Formatter bugs fixed
2022-01-11 21:14:17 -08:00
* 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.
2022-06-20 14:51:38 -07:00
[#23]: https://github.com/radian-software/apheleia/issues/23
[#47]: https://github.com/radian-software/apheleia/issues/47
[#52]: https://github.com/radian-software/apheleia/issues/52
[#58]: https://github.com/radian-software/apheleia/issues/58
[#60]: https://github.com/radian-software/apheleia/issues/60
[#62]: https://github.com/radian-software/apheleia/issues/62
[#64]: https://github.com/radian-software/apheleia/issues/64
[#65]: https://github.com/radian-software/apheleia/pull/65
[#68]: https://github.com/radian-software/apheleia/issues/68
[#69]: https://github.com/radian-software/apheleia/issues/69
[#74]: https://github.com/radian-software/apheleia/pull/74
2021-12-27 20:21:56 -08:00
2021-12-27 20:20:02 -08:00
## 1.2 (released 2021-12-27)
Support multiple formatters (#31) (#51) * Support multiple formatters (#31) Closes #31 This commit makes it so apheleia can run multiple formatters one after the other and use the resultant output to format the current buffer. This works somewhat like a pipeline. The output of one formatter becomes the input to the next formatter until all formatters have run and then an RCS patch is built from the resultant output and applied to the current buffer. Note: For convenience we internally represent the users configuration as a list of formatters even when it may only be one. For example if the user has configured `(python-mode . black)` in apheleia-mode-alist then internally we interpret that as a formatter list of `(black)` instead of `black` as we did previously. * Support multiple formatters (#31) Closes #31 This commit makes it so apheleia can run multiple formatters one after the other and use the resultant output to format the current buffer. This works somewhat like a pipeline. The output of one formatter becomes the input to the next formatter until all formatters have run and then an RCS patch is built from the resultant output and applied to the current buffer. Note: For convenience we internally represent the users configuration as a list of formatters even when it may only be one. For example if the user has configured `(python-mode . black)` in apheleia-mode-alist then internally we interpret that as a formatter list of `(black)` instead of `black` as we did previously. * Make some changes * Make some changes * Error when a (not-first) formatter uses file or filepath * Prevent formatter recieving stdin when using `file' Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-10-25 02:28:18 +01:00
### Enhancements
* Support multiple formatters ([#31]). You can now configure a list of
formatters for a major-mode in `apheleia-mode-alist` and they will
be run in sequence.
* Support evaluating items in `apheleia-formatters` to make formatter
commands more dynamic ([#50], [#55]).
Support multiple formatters (#31) (#51) * Support multiple formatters (#31) Closes #31 This commit makes it so apheleia can run multiple formatters one after the other and use the resultant output to format the current buffer. This works somewhat like a pipeline. The output of one formatter becomes the input to the next formatter until all formatters have run and then an RCS patch is built from the resultant output and applied to the current buffer. Note: For convenience we internally represent the users configuration as a list of formatters even when it may only be one. For example if the user has configured `(python-mode . black)` in apheleia-mode-alist then internally we interpret that as a formatter list of `(black)` instead of `black` as we did previously. * Support multiple formatters (#31) Closes #31 This commit makes it so apheleia can run multiple formatters one after the other and use the resultant output to format the current buffer. This works somewhat like a pipeline. The output of one formatter becomes the input to the next formatter until all formatters have run and then an RCS patch is built from the resultant output and applied to the current buffer. Note: For convenience we internally represent the users configuration as a list of formatters even when it may only be one. For example if the user has configured `(python-mode . black)` in apheleia-mode-alist then internally we interpret that as a formatter list of `(black)` instead of `black` as we did previously. * Make some changes * Make some changes * Error when a (not-first) formatter uses file or filepath * Prevent formatter recieving stdin when using `file' Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-10-25 02:28:18 +01:00
### Formatters
* [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) for
C/C++
* [`google-java-format`](https://github.com/google/google-java-format)
for Java
Support multiple formatters (#31) (#51) * Support multiple formatters (#31) Closes #31 This commit makes it so apheleia can run multiple formatters one after the other and use the resultant output to format the current buffer. This works somewhat like a pipeline. The output of one formatter becomes the input to the next formatter until all formatters have run and then an RCS patch is built from the resultant output and applied to the current buffer. Note: For convenience we internally represent the users configuration as a list of formatters even when it may only be one. For example if the user has configured `(python-mode . black)` in apheleia-mode-alist then internally we interpret that as a formatter list of `(black)` instead of `black` as we did previously. * Support multiple formatters (#31) Closes #31 This commit makes it so apheleia can run multiple formatters one after the other and use the resultant output to format the current buffer. This works somewhat like a pipeline. The output of one formatter becomes the input to the next formatter until all formatters have run and then an RCS patch is built from the resultant output and applied to the current buffer. Note: For convenience we internally represent the users configuration as a list of formatters even when it may only be one. For example if the user has configured `(python-mode . black)` in apheleia-mode-alist then internally we interpret that as a formatter list of `(black)` instead of `black` as we did previously. * Make some changes * Make some changes * Error when a (not-first) formatter uses file or filepath * Prevent formatter recieving stdin when using `file' Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-10-25 02:28:18 +01:00
* [isort](https://github.com/PyCQA/isort) for
[Python](https://www.python.org/) ([#51])
* [latexindent](https://ctan.org/pkg/latexindent?lang=en) for
[LaTeX](https://www.latex-project.org/)
* [rustfmt](https://github.com/rust-lang/rustfmt) for
[Rust](https://www.rust-lang.org/) ([#24])
* [`mix format`](https://hexdocs.pm/mix/1.12/Mix.Tasks.Format.html)
for Elixir ([#48])
* [`@prettier/plugin-ruby`](https://github.com/prettier/plugin-ruby)
for Ruby ([#49])
2021-02-26 22:04:15 -08:00
### Bugs fixed
* Fix spelling error in generated process names ([#32]).
2021-12-29 17:13:28 -07:00
* Apheleia no longer conflicts with undo-fu ([#39]).
* Apheleia no longer triggers `after-set-visited-file-name-hook`,
which reduces conflicts with various modes. For example, `lsp-mode`
will no longer trigger a reconnect every time you save.
* Fix inconsistent `:type` spec preventing use of `customize-variable`
on `apheleia-formatters`.
* Fix mixed style line ending generated by `diff` ([#54]) by adding
`--strip-trailing-cr` to `diff`'s argument list.
2021-02-26 22:04:15 -08:00
2022-06-20 14:51:38 -07:00
[#24]: https://github.com/radian-software/apheleia/pull/24
[#30]: https://github.com/radian-software/apheleia/issues/30
[#31]: https://github.com/radian-software/apheleia/issues/31
[#32]: https://github.com/radian-software/apheleia/pull/32
[#39]: https://github.com/radian-software/apheleia/issues/39
[#48]: https://github.com/radian-software/apheleia/pull/48
[#49]: https://github.com/radian-software/apheleia/pull/49
[#50]: https://github.com/radian-software/apheleia/pull/50
[#51]: https://github.com/radian-software/apheleia/pull/51
[#54]: https://github.com/radian-software/apheleia/pull/54
[#55]: https://github.com/radian-software/apheleia/issues/55
[#64]: https://github.com/radian-software/apheleia/issues/64
[#65]: https://github.com/radian-software/apheleia/pull/65
2021-02-26 22:04:15 -08:00
2021-02-26 22:04:05 -08:00
## 1.1.2 (released 2021-02-26)
2020-11-07 07:04:41 -08:00
### Enhancements
* Prettier is now enabled in `json-mode`.
### Bugs fixed
* Prettier now respects `.prettierignore` ([#21]).
* Apheleia's global mode should no longer trigger warnings about a locally
let-bound `after-save-hook` ([#27]).
2022-06-20 14:51:38 -07:00
[#21]: https://github.com/radian-software/apheleia/issues/21
[#27]: https://github.com/radian-software/apheleia/issues/27
2020-07-16 08:22:54 -06:00
## 1.1.1 (released 2020-07-16)
### Formatters
* New: [OCamlFormat](https://github.com/ocaml-ppx/ocamlformat) for
[Ocaml](https://ocaml.org/) ([#19]).
2020-04-02 08:58:41 -06:00
### Bugs fixed
* Previously, there were some race conditions related to switching the
current buffer. In particular, if you switched the current buffer
right after saving, or save two buffers in quick succession, then it
was possible for one buffer to be overwritten or to not be
formatted. These problems have been fixed ([#8]).
* Previously, enabling `undo-tree-auto-save-history` caused Apheleia
to mark the buffer as modified after formatting. This has been
fixed ([#10]).
2020-07-16 08:22:54 -06:00
* Apheleia now tries harder to accidentally enter an infinite
formatting loop ([#12]).
2020-04-02 08:58:41 -06:00
2022-06-20 14:51:38 -07:00
[#8]: https://github.com/radian-software/apheleia/issues/8
[#10]: https://github.com/radian-software/apheleia/issues/10
[#12]: https://github.com/radian-software/apheleia/pull/12
[#19]: https://github.com/radian-software/apheleia/pull/19
2020-04-02 08:58:41 -06:00
2020-04-02 08:54:06 -06:00
## 1.1 (released 2020-04-02)
2020-03-19 08:21:49 -06:00
### Enhancements
* There is now a maximum length for the dynamic programming algorithm,
controlled by `apheleia-max-alignment-size`. This prevents Emacs
from hanging due to Apheleia. under any circumstances ([#4]).
### Formatters
* New: [Brittany](https://hackage.haskell.org/package/brittany) for
[Haskell](https://www.haskell.org/).
### Bugs fixed
* Previously, weirdness could happen if manually running Prettier via
`M-x apheleia-format-buffer` on a buffer which was modified from
what was written to disk. Now we simply abort running a command that
uses the `file` keyword if the buffer is modified, since it will not
produce correct results. This should not affect normal usage of
Apheleia.
2020-03-19 08:21:49 -06:00
* Previously, the buffer could be erased when running Apheleia from a
buffer that had no backing file. This has been fixed, and Apheleia
can run correctly on buffers both with and without backing files
([#9]).
2022-06-20 14:51:38 -07:00
[#4]: https://github.com/radian-software/apheleia/issues/4
[#9]: https://github.com/radian-software/apheleia/pull/9
2019-09-20 17:08:09 -07:00
## 1.0 (released 2019-09-20)
### Added
* Package `apheleia`
* Command `apheleia-format-buffer`
* User options:
* `apheleia-formatters`, with supported formatters:
* `black`
* `prettier`
* `gofmt`
* `terraform`
* `apheleia-mode-alist`
* `apheleia-post-format-hook`
* Variable `apheleia-formatter`
* Minor mode `apheleia-mode` (and `apheleia-global-mode`)
[keep a changelog]: https://keepachangelog.com/en/1.0.0/