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-04-10 22:21:50 +01:00
|
|
|
## Unreleased
|
|
|
|
### 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.
|
|
|
|
|
2022-05-12 00:26:22 +01:00
|
|
|
### Enhancements
|
|
|
|
* Ocamlformat is now used in `caml-mode` in addition to `tuareg-mode`
|
|
|
|
([#94]).
|
|
|
|
|
2022-05-02 05:51:27 +08:00
|
|
|
### Formatters
|
|
|
|
* [dart-format](https://dart.dev/tools/dart-format) for Dart ([#89]).
|
2022-05-12 00:26:33 +01:00
|
|
|
* [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for PHP
|
|
|
|
([#87]).
|
2022-05-02 05:51:27 +08:00
|
|
|
|
2022-04-10 22:21:50 +01:00
|
|
|
### Features
|
|
|
|
* Support remote files and buffers that were opened through TRAMP
|
|
|
|
([#33]).
|
|
|
|
|
|
|
|
[#33]: https://github.com/raxod502/apheleia/issues/33
|
2022-05-12 00:26:33 +01:00
|
|
|
[#87]: https://github.com/raxod502/apheleia/pull/87
|
2022-05-02 05:51:27 +08:00
|
|
|
[#89]: https://github.com/raxod502/apheleia/pull/89
|
2022-05-12 00:26:22 +01:00
|
|
|
[#94]: https://github.com/radian-software/apheleia/pull/94
|
2022-04-10 22:21:50 +01:00
|
|
|
|
2022-04-10 13:54:40 -07:00
|
|
|
## 2.0
|
2022-04-10 22:21:50 +01:00
|
|
|
### Breaking changes
|
2022-01-04 15:32:38 -08:00
|
|
|
* 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
|
2022-01-03 20:07:44 -08:00
|
|
|
`*apheleia-cmdname-log*` buffer if it fails, or unconditionally if
|
|
|
|
the new user option `apheleia-log-only-errors` is set to nil. See
|
2022-01-04 15:32:38 -08:00
|
|
|
[#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]).
|
|
|
|
|
2022-04-10 22:21:50 +01:00
|
|
|
### Features
|
2022-01-04 15:32:38 -08:00
|
|
|
* 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
|
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
|
|
|
|
2022-04-10 22:21:50 +01:00
|
|
|
### Enhancements
|
2022-01-15 00:29:26 +01:00
|
|
|
* 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.
|
|
|
|
|
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]).
|
2022-01-04 21:07:17 -08:00
|
|
|
* 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
|
|
|
|
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]).
|
|
|
|
|
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-01-04 16:21:10 -08:00
|
|
|
[#23]: https://github.com/raxod502/apheleia/issues/23
|
2022-01-04 16:08:04 -08:00
|
|
|
[#47]: https://github.com/raxod502/apheleia/issues/47
|
2021-12-27 20:21:56 -08:00
|
|
|
[#52]: https://github.com/raxod502/apheleia/issues/52
|
2022-01-04 21:07:17 -08:00
|
|
|
[#58]: https://github.com/raxod502/apheleia/issues/58
|
2021-12-27 20:21:56 -08:00
|
|
|
[#60]: https://github.com/raxod502/apheleia/issues/60
|
|
|
|
[#62]: https://github.com/raxod502/apheleia/issues/62
|
|
|
|
[#64]: https://github.com/raxod502/apheleia/issues/64
|
|
|
|
[#65]: https://github.com/raxod502/apheleia/pull/65
|
2022-01-02 16:50:52 -08:00
|
|
|
[#68]: https://github.com/raxod502/apheleia/issues/68
|
2022-01-02 16:41:20 -08:00
|
|
|
[#69]: https://github.com/raxod502/apheleia/issues/69
|
2022-01-15 00:29:26 +01:00
|
|
|
[#74]: https://github.com/raxod502/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)
|
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.
|
2021-10-31 17:57:44 +00:00
|
|
|
* Support evaluating items in `apheleia-formatters` to make formatter
|
|
|
|
commands more dynamic ([#50], [#55]).
|
2021-10-25 02:28:18 +01:00
|
|
|
|
2021-08-08 13:07:08 +00:00
|
|
|
### Formatters
|
|
|
|
* [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) for
|
2021-10-03 12:18:03 -06:00
|
|
|
C/C++
|
|
|
|
* [`google-java-format`](https://github.com/google/google-java-format)
|
|
|
|
for Java
|
2021-10-25 02:28:18 +01:00
|
|
|
* [isort](https://github.com/PyCQA/isort) for
|
|
|
|
[Python](https://www.python.org/) ([#51])
|
2021-10-03 12:18:03 -06:00
|
|
|
* [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-08-08 13:07:08 +00:00
|
|
|
|
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]).
|
2021-05-23 14:59:26 -07:00
|
|
|
* 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.
|
2021-07-22 22:16:42 -04:00
|
|
|
* Fix inconsistent `:type` spec preventing use of `customize-variable`
|
|
|
|
on `apheleia-formatters`.
|
2021-10-31 23:55:26 +06:00
|
|
|
* 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
|
|
|
|
2021-08-08 13:07:08 +00:00
|
|
|
[#24]: https://github.com/raxod502/apheleia/pull/24
|
2021-02-26 22:04:15 -08:00
|
|
|
[#30]: https://github.com/raxod502/apheleia/issues/30
|
2021-10-25 02:28:18 +01:00
|
|
|
[#31]: https://github.com/raxod502/apheleia/issues/31
|
2021-02-26 22:04:15 -08:00
|
|
|
[#32]: https://github.com/raxod502/apheleia/pull/32
|
2021-03-28 15:25:15 -07:00
|
|
|
[#39]: https://github.com/raxod502/apheleia/issues/39
|
2021-10-03 12:18:03 -06:00
|
|
|
[#48]: https://github.com/raxod502/apheleia/pull/48
|
|
|
|
[#49]: https://github.com/raxod502/apheleia/pull/49
|
2021-10-31 17:57:44 +00:00
|
|
|
[#50]: https://github.com/raxod502/apheleia/pull/50
|
2021-12-29 16:14:54 -08:00
|
|
|
[#51]: https://github.com/raxod502/apheleia/pull/51
|
2021-10-31 23:55:26 +06:00
|
|
|
[#54]: https://github.com/raxod502/apheleia/pull/54
|
2021-10-31 17:57:44 +00:00
|
|
|
[#55]: https://github.com/raxod502/apheleia/issues/55
|
Run the same formatter in multiple buffers in parallel (#64) (#65) (#65)
* Run the same formatter in multiple buffers in parallel (#64) (#65)
Previously when apheleia formatted a buffer it created a stdout and
stderr buffer for each formatter, but it reused this buffer each time
that formatter would run. This makes sense if we only ever format one
buffer at a time (meaning we don't format a new buffer until the
previous buffer has been formatted) such as when calling
`apheleia-format-buffer` interactively (since the interval for running a
formatter is likely far below hitting a key combination for this
command). But this assumption falls apart when using `apheleia-mode` and
`apheleia--format-after-save`.
Now a lot of files could be saved, triggering the same formatters again
and again, within a short period of each other. Apheleia used to keep
track of the current formatter process and kill it when a newer
formatter is attempted, but this also kills all but the last buffer
called by `apheleia--format-after-save`.
With this commit we still have separate stdout and stderr buffers for
each formatter, but we *always* create a new one when attempting a
format. There is a new buffer type, a log buffer, which is populated
with a formatter processes stderr when it fails. We also still have a
`apheleia--current-process` variable, but instead of being global, it's
local to the current buffer being formatted. We now kill it if starting
a new format in the current buffer, but two separate buffers can call
the same formatter with no issue.
* Mark change as bugfix in changelog
* Add to docstring
* Remove no longer needed code
* Re-wrap docstring
* Remove newline
* Change spelling
* Use correct buffer when checking (buffer-size)
Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-12-26 20:52:52 +00:00
|
|
|
[#64]: https://github.com/raxod502/apheleia/issues/64
|
|
|
|
[#65]: https://github.com/raxod502/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`.
|
|
|
|
|
2020-10-17 08:29:21 -07:00
|
|
|
### Bugs fixed
|
|
|
|
* Prettier now respects `.prettierignore` ([#21]).
|
2021-02-07 18:50:31 +02:00
|
|
|
* Apheleia's global mode should no longer trigger warnings about a locally
|
|
|
|
let-bound `after-save-hook` ([#27]).
|
2020-10-17 08:29:21 -07:00
|
|
|
|
|
|
|
[#21]: https://github.com/raxod502/apheleia/issues/21
|
2021-02-07 18:50:31 +02:00
|
|
|
[#27]: https://github.com/raxod502/apheleia/issues/27
|
2020-10-17 08:29:21 -07:00
|
|
|
|
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
|
|
|
|
|
|
|
[#8]: https://github.com/raxod502/apheleia/issues/8
|
|
|
|
[#10]: https://github.com/raxod502/apheleia/issues/10
|
2020-07-16 08:22:54 -06:00
|
|
|
[#12]: https://github.com/raxod502/apheleia/pull/12
|
|
|
|
[#19]: https://github.com/raxod502/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/).
|
|
|
|
|
2019-12-31 10:16:32 -07:00
|
|
|
### 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]).
|
|
|
|
|
|
|
|
[#4]: https://github.com/raxod502/apheleia/issues/4
|
|
|
|
[#9]: https://github.com/raxod502/apheleia/pull/9
|
2019-12-31 10:16:32 -07:00
|
|
|
|
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/
|