Releases: radian-software/apheleia
Releases · radian-software/apheleia
Apheleia 4.4.2
Bugs fixed
- apheleia-formatters-indent did not handle yaml-ts-mode; added with same behaviour as yaml-mode
- apheleia-formatters-indent did not handle js-json-mode; added with same behaviour as json-mode
- A formatter that adds indentation while point is at the end of the line would sometimes leave point at the wrong position (#362).
Formatters
Apheleia 4.4.1
Enhancements
- Black will respect configuration in
pyproject.tomlwhen run via Apheleia.
Bugs fixed
- A formatter that moves a line to the top of the file would sometimes place it as the second line instead (#299).
- Fix invoking the diff command on Windows by always passing the --text flag.
Formatters
- Format Bazel files according to their type
Apheleia 4.4
Bugs fixed
$PATHwas not correctly respected for some remote executables (#341).
Formatters
- cljstyle for clojure, clojurescript, edn files.
biome(#339).gdformatfor gdscript (#342).prettier-json-stringify(#183).nix-ts-modebuffers are now formatted with nixfmt likenix-modebuffers are.- Fix
foumoluarguements - Both
haskell-modeand the newly addedhaskell-ts-modebuffers are formatted withfourmolu
Internal
- You can run the formatter tests locally with podman instead of docker now, if you want. Export
USE_PODMAN=1(#343).
Apheleia 4.3
Features
- New user option
apheleia-skip-functions, likeapheleia-inhibit-functionsbut for skipping a formatter run even whenapheleia-modeis generally enabled (#317). ocp-indentfor Ocaml (#306).
Formatters
vfmtfor vlang (#324).typstylefor typst (#313).rubocopchanged to use-ainstead of deprecated--auto-correct(#316).snakefmtofficial formatter for Snakemake (#307).gleamofficial formatter forgleam(#325)zig fmtofficial formatter for zig (#327).
Bugs fixed
apheleia-npxwould use an incorrect path for the Yarn PnP ESM loader (#301).apheleia-npxdid not correctly guard against word splitting and would fail when directory names contained spaces (#301).apheleia-npxwas sometimes not able to find formatters in a Yarn PnP project if there was also anode_modulesfolder at the root of the project (#301).- Ormolu is now passed the
--stdin-input-fileargument, which has become required (#312). mix formatis now passed the--stdin-filenameargument which is required in some cases. The version of Mix is autodetected and this option is only passed when it is supported (#319).mix formatis now run withMIX_QUIETto supress compilation output (#326)- Beancount files are formatted without an error (#309).
Internal
- Improvements to formatter test framework, it is now possible to write tests that have additional data files (#301).
Apheleia 4.2
Changes
- Custom Emacs Lisp formatting functions have the option to report an error asynchronously by invoking their callback with an error as argument. Passing nil as argument indicates that there was no error, as before. The old calling convention is still supported for backwards compatibility, and errors can also be reported by throwing, as normal. Implemented in #204.
Features
- New user option
apheleia-mode-predicates. The default value handlesmhtml-modecorrectly by always using whatever formatter you have configured for that mode, rather than usingcss-mode,html-mode, etc formatters depending on the position of point (#302).
Enhancements
- There is a new keyword argument to
apheleia-format-bufferwhich is a more powerful callback that is guaranteed to be called except in cases of synchronous nonlocal exit. See the docstring for details. The old callback, which is only invoked on success and receives no information about errors, is still supported and will continue to be called if provided. See #204.
Formatters
Bugs fixed
- The point alignment algorithm, which has been slightly wrong since 2019, has been fixed to more correctly use dynamic programming to maintain the position of point. Also, some cases of a nil pointer error during point alignment have been fixed (#290).
apheleia-indent-lisp-bufferupdated to apply local variables after calling major-mode. Also includes setting forindent-tabs-mode(#286).- Formatter scripts will now work on Windows if Emacs can find the executable defined in the shebang.
Internal
Apheleia 4.1
Enhancements
- Use
perltidyas default formatter forcperl-mode(#260). - The
perltidyformatter now supports Emacs indentation and line length settings (#261). - Indent level is now determined for
graphql-mode,html-mode,ruby-mode,ruby-ts-mode,svelte-mode, andyaml-mode(#258). - Indent level support when using yq to format JSON, XML, and YAML (#259).
Formatters
dprintfor various (depending on installed plugins) (#209).js-beautifyfor JavaScript, JSON, HTML and CSS (#229)python3-jsonfor JSON (#257).robotidyfor Robot Framework files (#263).ruff-isortfor Python imports using ruff (#279).- denofmt for js, jsx, ts, tsx, json, jsonc, md files. (#264)
- docformatter for Python docstrings (#267)
- cljfmt for clojure, clojurescript, edn files. (#271)
- Stylua is used now in
lua-ts-modeas well as justlua-mode, by default (#275). treefmtfor project configured formatters ([#280]).pyangfor YANG (#282).
Bugs fixed
- Apheleia sometimes failed to determine indent level from Emacs settings even when configured to do so. This is fixed (#274).
Apheleia 4.0
Breaking changes
- The order of entries in
apheleia-mode-alistis no longer as important. Specifically, if two different mode entries inapheleia-mode-alistmatch the current buffer, then the more specific one is used, even if it comes later. This is generally speaking what you would expect to happen. For other cases, such as ordering of regex entries, or modes versus regexes, order is respected as before ([#206]). - Disable formatting of go module files with gofmt. This was never supported (#214).
- Remove support for Emacs 26 (#215).
- Emacs will infer indentation configuration from your major mode and, by default, supply this configuration to formatters, to ensure consistency between how you have Emacs configured and how your formatter is configured. You can disable this by setting
apheleia-formatters-respect-indent-levelto nil (#167, #208).
Enhancements
- Use the
prettier-jsonformatter forjs-json-mode(#209). - Prettier is now enabled in
svelte-mode. - More tree-sitter based major modes have been added to
apheleia-mode-alist([#191]). - All marks (the current
(mark), and themark-ring) are now adjusted, alongside(point)(#197). - Built-in formatters now use a new
"apheleia-npx"built-in script instead of the legacynpxkeyword. The effect of the new script is the same, except that it also works with Yarn PNP projects as well asnode_modulesstyle projects ([#200]). - Autoload the apheleia-goto-error command (#215).
- Use
lisp-indentas default formatter foremacs-lisp-mode(#223) - Use
hclfmtfor formatting hashicorp HCL files (#231) - The
mix formatformatter will respect.formatter.exsfiles even if they are present in a parent directory rather than the same directory as the file being formatted (#232).
Internal Changes
- Refactored the organisation of the apheleia package for ease of understanding and usability (#215).
- The new
scripts/pnp-bin.jsscript is standalone minified nodejs built from thepnp-binrepo, extracted from apheleia PR [#200]. - Test environment bumped from Ubuntu 20.04 to 22.04 (#242).
- The function
apheleia--format-after-savewas renamed toapheleia-format-after-save. This is only called out explicitly because it was added toafter-save-hookso customization that assumed this behavior might break.
Bugs fixed
ktlintwould emit log messages into its stdout when formatting, and these would get spliced into the source file. This has been fixed by suppressing all logs fromktlint.- Disable colorized output with the jq formatter (#213).
- Fixed apheleia skipped running a formatter on a remote when it isn't installed locally (#215).
- Fixed clang-format formatter did not respect remote file-name component for the assumed file-name (#215).
- Always supply
--stdin-filepathto Prettier to allow it to pick up the correct settings from project-level config files (#253).
Formatters
asmfmtfor assembly (#168).astylefor C (#169).beautyshfor shell scripts (#170)buildifierfor Bazel Build (#171).cmake-formatfor CMake (#172).fourmolufor haskellgawkfor awk (#187).hclfmtfor HCL (#231)html-tidyfor HTML/XML (#173).jqfor JSON (#174).ormolufor haskell.perltidyfor perl (#175).pgformatterfor SQL (#247)- purs-tidy for PureScript (#182).
rubocopfor ruby (#176).ruby-standardfor ruby ([#201])rufffor python (#236)rufofor Ruby (#177).xmllintfor XML ([#251]).yapffor Python (#196)yqfor YAML, JSON, CSV, TSV, XML and .properties ([#250]).
Apheleia 3.2
Features
- You can use
apheleia-inhibitas a file-local variable to disable Apheleia turning on automatically for a file or directory. You can also useapheleia-inhibit-functionsto 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-modelighter is now customizable (#143).
Changes
- shfmt is no longer enabled by default in order to prevent corruption of zsh scripts. Re-enabling shfmt in a future release is intended, but depends on further implementation work in Apheleia to only enable it for supported shells.
Enhancements
- Emacs 29's tree-sitter-based major modes have been added to
apheleia-mode-alist(#145, #148, [#151], [#155]).
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.
- Npx commands in apheleia-formatters are not overwritten when expanding binary path to node_modules directory (#152).
- Error is no longer reported when the first element of a command is an evaluable form rather than a literal string ([#156]).
Formatters
Apheleia 3.1
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
--parserargument explicitly, so it will work properly even when the name of the file does not match what Prettier expects (e.g..yamllintwill be formatted as YAML by Prettier as long as it is inyaml-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
inplacein 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)toapheleia-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.
Apheleia 3.0
Breaking changes
- The arguments of formatters defined as Elisp functions has changed. A formatter function should now be a
cl-defuntaking key-value arguments with support for more keys being provided on a later apheleia release (by including&allow-other-keysin the parameter list). For a list of provided arguments seeapheleia--run-formatter-function. - Emacs 25 is no longer supported.
Enhancements
- Ocamlformat is now used in
caml-modein addition totuareg-mode(#94).
Formatters
Features
- Support remote files and buffers that were opened through TRAMP (#33).