| Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
## 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)
```
|
|
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
|
|
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>
|
|
Add support for `bibtex-mode` using emacs native function
`bibtex-reformat`.
|
|
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.
|
|
Taplo is a very popular formatter and linter for TOML.
https://github.com/tamasfe/taplo
|
|
Unfortunately, I have to write some C#
|
|
|
|
This is a more specific formatter than `hclfmt` for nomad files.
|
|
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
|
|
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.
|
|
Helps to test #331. No reason that docker should work and podman
shouldn't.

|
|
Add support for [cljstyle](https://github.com/greglook/cljstyle)
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
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>
|
|
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
|
|
See https://biomejs.dev/
Alternative formatter to `prettier`
closes https://github.com/radian-software/apheleia/issues/323
|
|
https://github.com/vlang/v
---------
Co-authored-by: Raphael Nahoum <raphaelnahoum@Flrians-MBP.localdomain>
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
support gleam language
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
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>
|
|
https://github.com/snakemake/snakefmt
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
|
|
Closes #319 because this does the same thing but it transparently works
for all versions of mix-format.
|
|
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).
|
|
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>
|
|
Formatter for typst
https://github.com/Enter-tainer/typstyle
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
* `apheleia-npx` would use an incorrect path for the Yarn PnP ESM
loader.
* `apheleia-npx` did not correctly guard against word splitting.
* `apheleia-npx` was sometimes not able to find formatters in a Yarn PnP
project if there was also a node_modules folder at the root of the
project. Unfortunately, many tools (including
[Prettier](https://github.com/prettier/prettier/issues/13032)) will
create a cache folder in `node_modules` even in Yarn PnP projects. The
presence of any `node_modules` folders are irrelevant when a `.pnp.cjs`
file is present.
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
For https://github.com/radian-software/apheleia/issues/302. Not tested
yet. Going to add unit tests before merging.
|
|
Work in progress, some of the code is cribbed from
https://github.com/radian-software/dumbparens
|
|
In the case where s2 is larger than s1, this errors because the index is
out of range.
A good testcase is the below
```lisp
(apheleia--align-point
" <div class=\"left-[40rem] fixed inset-y-0 right-0 z-0 hidden lg:block xl:left-[50rem]\">\n <svg\n"
"<div class=\"left-[40rem] fixed inset-y-0 right-0 z-0 hidden lg:block xl:left-[50rem]\">\n <svg"
6)
```
If I've implemented the indexing wrong, do let me know but this seems to
work just fine now for `mix` (the formatter that triggered this)
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
Adds a new formatter `dhall-format` used for
[dhall](https://dhall-lang.org/).
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
Hi,
pyang (https://github.com/mbj4668/pyang) is a YANG validator,
transformator and code generator, written in python. YANG (RFC 7950) is
a data modeling language for NETCONF (RFC 6241), developed by the IETF
NETMOD WG. This formatter provides support for Emacs yang-mode.
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
`ruff` doesn't run isort as part of its format, so to maintain parity
with the sort rules that black/isort offer, this is the ruff isort.
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
This formatter is formatting via
[treefmt](https://numtide.github.io/treefmt). This is useful if the
project is configuring formatters for the project and you don't have to
replicate this logic within Emacs, but instead utilize treefmt directly.
To do that you can set the `apheleia-formatter` to `treefmt` within the
projects `.dir-locals.el`.
I noticed there are tests for this, since treefmt could technically
format anything, I went with treefmt formatting rust code. It also
relies on having a `treefmt.toml` in the project folder, so had to add
that as well in the tests.
|
|
Add [ruby-syntax-tree](https://github.com/ruby-syntax-tree/syntax_tree)
as an available formatter. Include support for finding a [`.streerc`
file](https://github.com/ruby-syntax-tree/syntax_tree#configuration).
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
Add [docformatter](https://github.com/PyCQA/docformatter) for Python
docstrings.
By default it outputs diffs but changes in-place with `--in-place`. On
successful change it exits with an error code of `3` (found out by
trial), so I had to add a formatter wrapping-script.
Initially I used `--in-place` with the special `in-place` symbol in
apheleia. But now I tried an approach where I transform the diff into
usable stdout using `patch` instead.
Related to #266 , where I had used the example of docformatter to ask
how to add scripts with positive exit codes and @raxod502 showed me the
`phpcs` solution.
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
https://dprint.dev
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|
|
https://docs.python.org/3/library/json.html#module-json.tool
|
|
|
|
|
|
|
|
|
|
Add support for [`pgFormatter`](https://github.com/darold/pgFormatter)
for `sql-mode`.
<!--
To expedite the pull request process, please see the contributor guide
for my projects:
<https://github.com/raxod502/contributor-guide>
-->
|
|
|
|
<!--
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>
|
|
<!--
To expedite the pull request process, please see the contributor guide
for my projects:
<https://github.com/raxod502/contributor-guide>
-->
|
|
Some things I noticed from
https://github.com/radian-software/apheleia/pull/242 but didn't want to
patch in place because CI had passed already.
|
|
This also fixes a few test installers:
- rustfmt is available via apt-get in 22.04, use that instead of tarball
that's no longer available
- brittany now installs cleanly in the default haskell ghc/cabal in
22.04, so just use that
- perltidy in 22.04 has slightly different output
- nixfmt download url changed (now includes OS/arch). There was
initially no binary available when nixfmt was updated,
but the devs there were kind enough to provide one:
https://github.com/serokell/nixfmt/issues/139
This runs a full `make fmt-build` without errors, though it takes a
while ;). All tests pass, too.
|
|
This adds support for formatters installed locally in project
directories via yarn 2's "zero install" [pnp
mode](https://yarnpkg.com/features/pnp).
It's quite similar to the support for formatters installed locally in a
project's `node_modules` via npm, and leverages the `npx` symbol, so
existing formatter definitions should work without modification.
This checks for a `.pnp.cjs` file (expected in the project root for yarn
pnp projects), then looks for a yarn executable, and checks the version
of yarn to make sure it supports pnp. If that works, we just push
`"yarn"` onto the front of `command`.
I've only tested this with a locally installed `prettier.js`. It's very
much a works-for-me draft, I'm putting in a PR to make sure this is a
workable approach before going any further with it.
---------
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
|