aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-04-21Check changelog properlyHEADmainRadon Rosborough
2026-04-22fix: sync lisp-indent-offset and lisp-body-indent in ↵Chris Chen
apheleia-indent-lisp-buffer (#393) apheleia-indent-lisp-buffer copies several buffer-local variables to the scratch buffer before running indent-region, but lisp-indent-offset and lisp-body-indent are missing. When either of these is set in the original buffer, the scratch buffer falls back to different defaults, producing indentation that disagrees with what indent-region would produce interactively. Reproducer: with lisp-indent-offset set to 2, the following form (setopt lsp-inlay-hint-enable t lsp-log-io nil) formats to one space of indentation instead of two. Fix: sync lisp-indent-offset and lisp-body-indent from the original buffer to the scratch buffer, the same way the existing code already does for indent-line-function, lisp-indent-function, and indent-tabs-mode. --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2026-04-14Add OpenTofu, use by default for Terraform (#391)Radon Rosborough
Seems fairly straightforward to me, Terraform is no longer open-source, OpenTofu is the compatible open-source successor, similar to the Redis/Valkey situation. Of course, if someone still prefers to use Terraform instead, they can easily customize using: ```tf (setf (alist-get 'terraform-mode apheleia-mode-alist) 'terraform) ``` We don't have a mechanism for allowing multiple formatters to be registered for the same major mode, where later ones could be used if earlier ones are not installed. That might be a nice addition.
2026-03-12OCaml: Add neocaml modes for ocamlformat (#389)Mattias
Add neocaml-mode and neocaml-interface-mode to the list of modes that can be formatted with ocamlformat
2026-03-06fix: support for gdiff in UNIX-like systems (#388)Jose Maldonado
In OpenBSD and FreeBSD, `diff` don't have support for `--rcs`. In these cases, we need to use `gdiff` or `GNU diff` for this support. This change, fix the use of `diff `or `gdiff` for these OSes and make apheleia work.
2026-02-21Release version 4.4.3v4.4.3Radon Rosborough
2026-01-20Remove --no-doc argument from yq-yaml formatter (#386)Andreas Kurth
The --no-doc argument removes existing document separators (---) from yaml files. It is perfectly valid and common practice to use multiple documents within a single file, e.g. in the kubernetes universe. Formatting such files with --no-doc breaks their validity. See also the prettier-yaml test, which preserves the document separator, too.
2025-12-23apheleia-npx: return silently when formatter is missing (#383)Frédéric Giquel
Behavior of `aphaleia-npx` currently differs from other formatters by triggering an error when formatter is missing (causing a message to be displayed in minibuffer and an error buffer to be created). This PR adds a test to check if command is on user's PATH before executing it in order to make `aphaleia-npx` silently ends when the formatter command is not found at project and system level.
2025-12-13Add support for oxfmt formatter (#382)Mike Olson
## Summary - Add oxfmt (Oxc Formatter) as a new formatter option for JavaScript and TypeScript files ## Details [Oxfmt](https://oxc.rs/docs/guide/usage/formatter) is a Rust-powered, Prettier-compatible code formatter from the Oxc project. It's currently in alpha but offers significant performance improvements (30x+ faster than Prettier). Key points: - Uses `inplace` mode since oxfmt doesn't support stdin/stdout - Works with all common JS/TS extensions (.js, .jsx, .mjs, .cjs, .ts, .tsx, .mts) - Not added to `apheleia-mode-alist` - users can opt-in by setting `apheleia-formatter` to `oxfmt` - Defaults are already sensible: 2-space indent, printWidth 100, no tabs Example usage: ```elisp (setf (alist-get 'oxfmt apheleia-formatters) '("apheleia-npx" "oxfmt" inplace)) ;; To use for JS/TS files: (setq-default apheleia-formatter 'oxfmt) ;; Or per-mode: (setf (alist-get 'typescript-ts-mode apheleia-mode-alist) 'oxfmt) ```
2025-12-10Pass --force-exclusion to rubocop (#380)Ibrahim Awwal
This make rubocop obey exclusions from config files. Otherwise, even if a file is excluded from in .rubocop.yml, apheleia will still format it. See https://docs.rubocop.org/rubocop/usage/basic_usage.html#command-line-flags
2025-12-01Fix shfmt when used with apheleia-formatters-respect-indent-level (#379)Tej Chajed
The shfmt formatter produced an invalid command invocation. The symptom was an error: `eval: Invalid function: "-i"` I couldn't figure out how to splice the list in correctly but `--indent=` can be passed as one argument. --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2025-11-28Add support for bibtex-mode (#294)Vu Quoc Huy
Add support for `bibtex-mode` using emacs native function `bibtex-reformat`.
2025-11-23Use clang-format for formatting Objective-C/C++ (#378)Aleksey Sakovets
Hi, This adds formatting of Objective-C/C++ files via clang-format. I was unsure about adding support for Objective-C++ (*.mm) since Emacs doesn't have a dedicated mode for such files and regexp association in `apheleia-mode-alist` feels a bit out of place. Please, correct me if this is wrong.
2025-11-21Fix two typosRadon Rosborough
2025-11-21Release version 4.4.2v4.4.2Radon Rosborough
2025-11-11Add styleR for ess-r-mode (#377)Martin Edström
Hi! My first time adding a formatter, please let me know if I missed anything. Some things I'm unclear about: 1. How to fail gracefully when [styleR](https://styler.r-lib.org/) package is absent from the system 2. Whether the formatter should be named `ess-r` or something more general like `rlang` ## Test case FYI, there are loads of tests to pick from on https://github.com/r-lib/styler/tree/main/tests/testthat. I picked [unindention/mixed-in.R](https://github.com/r-lib/styler/blob/main/tests/testthat/unindention/mixed-in.R), but oddly, the output [unindention/mixed-out.R](https://github.com/r-lib/styler/blob/main/tests/testthat/unindention/mixed-out.R) isn't quite the same as we got! I don't know if that's an upstream issue, or that upstream changed style since that test was written, or that perhaps the file is meant to be concatenated into something else.
2025-08-07add `js-json-mode` to `apheleia-formatters-indent` (#375)gkowzan
Add `js-json-mode` to `apheleia-formatters-indent` with the same behavior as `json-mode`.
2025-07-24Add taplo for formatting TOML files (#373)Jimmy Yuen Ho Wong
Taplo is a very popular formatter and linter for TOML. https://github.com/tamasfe/taplo
2025-07-20Run tests against Emacs 30 (#372)Radon Rosborough
2025-07-20Add csharpier for C# (#371)Radon Rosborough
Unfortunately, I have to write some C#
2025-07-18add yaml-ts-mode to aphelia-formatters-indent (#370)James Ferguson
Trivial change - other modes include `-ts-mode` variants, but not yaml. This fix is confirmed to work for me, taking the indent level from `yaml-indent-offset`. --------- Co-authored-by: James Ferguson <james@faff.org>
2025-06-11Add support for `hurlfmt` to format `hurl` files (#365)Derek Passen
2025-05-19feat: add nomad formatter (#361)Matus Goljer
This is a more specific formatter than `hclfmt` for nomad files.
2025-05-19Fix moving point (#363)Trevor Murphy
When replacing text, calculate the cursor offset relative to the start of the replacement, not the end of the text-to-be-added. * test/integration/apheleia-it.el (supports-inserting-whitespace): New test case * apheleia-rcs.el (apheleia--apply-rcs-patch): Go to start of deletion text before calculating offsets
2025-05-13Release version 4.4.1v4.4.1Radon Rosborough
2025-04-27Pass --stdin-filename to Black (#360)Radon Rosborough
Option was added in Black 21.4b0 so should be relatively widely available.
2025-03-31Pass --text arg to diff (#356)Josh Kingsley
For some reason, GNU diff on Windows (from the MinGW project) fails to diff the file contents when passed over stdin unless the `--text` argument is passed. This argument forces diff to treat the inputs as text, and not binary. To reproduce this error with Bash on Windows: ``` $ echo foo > foo $ echo bar > bar $ cat bar | diff.exe foo - diff.exe: -: Invalid argument $ cat bar | diff.exe --text foo - 1c1 < foo --- > bar ``` It seems like this flag is harmless in this case, since Apheleia will always be used for diffing text files, and never binary files.
2025-03-08Fix patches moving a line to the top of the file. (#353)Guillaume Brunerie
RCS patches containing a 'a0' instruction are not handled properly. This pull request fixes the handling of 'a0' instructions and adds an integration test that fails otherwise. Fixes #299.
2025-03-04Specify file type for buildifier explicitly (#352)Claudio Bley
When formatting Bazel files, buildifier needs to know the concrete file type which it usually deduces from the file name which is impossible when operating on stdin. For example, the order of load statements in a WORKSPACE file is significant and re-ordering might break it. --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2025-02-12Release version 4.4v4.4Radon Rosborough
2025-02-07Resolve formatter executable commands prior to calling them (#341)Tyler Langlois
Hi! Thanks for your work on apheleia, it's great. An issue I've run into recently is that sometimes my remote executables aren't immediately in-`$PATH`: I need to resolve them via `executable-find` - which does find them - before invoking the process. This should be safe, given that the step is performed at a prior step. I'm overwriting the `command` variable since I infer that the executable _name_ is being reused later when you're matching a callback, I think? I mentioned that `executable-find` happens earlier in the call chain so I could maybe improve this by removing that and only resolving the executable once, but I wanted to check in with you to determine whether the overall problem and solution even make sense to somebody else. --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2025-02-03Add nix-ts-mode support (#300)identity
Fixes #298 --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2025-02-03Update haskell formatters (#349)Abhishek Singh
Co-authored-by: Abhishek Singh <abhisheksingh0x558@proton.me>
2025-01-21Add support for podman (#343)Radon Rosborough
Helps to test #331. No reason that docker should work and podman shouldn't. ![image](https://github.com/user-attachments/assets/598c914d-09ca-4124-af43-49d52c230b43)
2025-01-21Add support for `cljstyle` for Clojure code (#333)Derek Passen
Add support for [cljstyle](https://github.com/greglook/cljstyle) Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2025-01-19feat: add gdformat formatter for godot/gdscript (#342)Daniel Perez Alvarez
Add [gdformat](https://github.com/Scony/godot-gdscript-toolkit?tab=readme-ov-file#formatting-with-gdformat-more) for godot gdscript files See - https://godotengine.org/ - https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html - https://github.com/Scony/godot-gdscript-toolkit --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2025-01-19feat: add prettier-json-stringify formatter (#183)Daniel Perez Alvarez
Adds a new formatter for prettier `prettier-json-stringify` which uses prettier `json-stringify` parser. `json-stringify` parser is used by prettier for formatting package.json files
2025-01-18feat: add biome formatter (#339)Daniel Perez Alvarez
See https://biomejs.dev/ Alternative formatter to `prettier` closes https://github.com/radian-software/apheleia/issues/323
2025-01-12[#336] Fix broken link (#340)Radon Rosborough
Close https://github.com/radian-software/apheleia/issues/336
2024-11-12Release version 4.3v4.3Radon Rosborough
2024-10-18Add vfmt (#324)elogir
https://github.com/vlang/v --------- Co-authored-by: Raphael Nahoum <raphaelnahoum@Flrians-MBP.localdomain> Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2024-10-17support gleam language (#325)nohz.afk
support gleam language --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2024-10-17Set MIX_QUIET=1 when running mix format (#326)Andreas Knöpfle
With the current way of passing things to aphelia, sometimes compilation output gets added to the top of the formatted file. This is because `mix format -` will actually still use [`Mix.Shell.info/1`](https://hexdocs.pm/mix/1.17.3/Mix.Shell.html#c:info/1) to output thing like: ``` ==> module Compiling 56 files (.ex) ``` However `info` messages can be silenced when setting `MIX_QUIET`. Docs: https://hexdocs.pm/mix/1.17.3/Mix.html#module-environment-variables --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2024-10-17Add zig fmt support (#327)hgranthorner
Add support for the zig programming language using `zig fmt` for `zig-mode` and `zig-ts-mode`. --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2024-10-05Add snakefmt (#307)Edmund Miller
https://github.com/snakemake/snakefmt --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2024-10-05Fix commentRadon Rosborough
2024-10-05[#309] Write beancount files to disk before formatting (#310)John Goff
Fixes #309 The `bean-format` tool reads a file from the filename passed on the command line, then outputs the formatted file to `STDOUT`. The filename passed on the command line is a requirement, the `bean-format` tool does not read from `STDIN` at all. Another option would be to use `("bean-format" input "-o" output)`, but this way apheleia can avoid an extra file read that's not strictly necessary. --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2024-09-25Use --stdin-filename conditionally for mix-format (#322)Radon Rosborough
Closes #319 because this does the same thing but it transparently works for all versions of mix-format.
2024-09-21[#312] Fix Ormolu installation and invocation (#321)Radon Rosborough
Closes #312. The installation script was failing due to some Cabal bullshit that I don't even want to know the reason for, probably triggered by new package versions coming available, so I switched to upstream binaries. Applied the suggested fix from #312 for a new command-line option which has become required. Also set Ormolu as the default Haskell formatter instead of Brittany because that is what the Brittany dev recommends (see again #312).
2024-09-21Add ocp-indent as a formatter (#306)Puneeth Chaganti
ocp-indent allows indenting even partially compiling OCaml code, while ocamlformat requires the code to compile correctly. Also, Doom Emacs uses ocp-indent when ocamlformat's configuration file is not found, and not having an ocp-indent formatter gives an error. <!-- To expedite the pull request process, please see the contributor guide for my projects: <https://github.com/raxod502/contributor-guide> --> Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>