aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-03-10Allow long lines in unit testsalign-null-checkRadon Rosborough
2024-03-10Add unit testRadon Rosborough
2024-03-09fix: prevent null issues when strings are unequalEllis Kenyo
In the case where s2 is larger than s1, this errors because the index is out of range. --- no changelog update needed
2024-03-02Add changelog linter (#287)Radon Rosborough
This should help make sure we don't forget to document any important user-visible changes.
2024-03-02Update `apheleia-indent-lisp-buffer` to respect local variables (#286)tpeacock19
I ran into some issues using apheleia while contributing to a project that works with `indent-tabs-mode` disabled. This led to this slight modification of `apheleia-indent-lisp-buffer` This allows for any local values for `indent-line-function`, `lisp-indent-function` to be carried over when formatting. Additionally, added `indent-tabs-mode` in order to prevent adding tabs when unwanted.
2024-02-25Release version 4.1v4.1Radon Rosborough
2024-02-08add support for pyang (#282)sgherdao
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>
2024-01-12Add `ruff-isort` formatter (#279)Chris Rose
`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>
2024-01-12Add support for `treefmt` (#280)Terje Larsen
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.
2023-12-30[#274] Fix apheleia-formatters-indent logic (#277)Radon Rosborough
Closes #274
2023-12-30Delete apheleia-formatters-args-from-file (#273)Nolan
Remove unused artifact from #224
2023-12-30Extend lua support to lua-ts-mode (#275)Derek Passen
Available via https://git.sr.ht/~johnmuhl/lua-ts-mode and https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=b6659e98a4fcaa44477b64d7782243feca020418 --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-12-21[#220] Disable in jinja2-mode by default (#238)Radon Rosborough
Close #220
2023-12-21Add ruby-syntax-tree format support (#224)Nolan
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>
2023-12-14Add indent level support for yq JSON, XML, and YAML (#259)Ville Skyttä
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-12-14Determine indent level from more modes (#258)Ville Skyttä
Pass CSS, GraphQL, HTML, Ruby, Svelte, and YAML mode indent setting to formatters that make use of it through `apheleia-formatters-js-indent`. `prettier-markdown` and `prettier-scss` attempt to make use of this too, but `markdown-mode` and `scss-mode` don't have such a setting that I can tell. Left the uses in place for `indent-tabs-mode` support anyway. BTW the `apheleia-formatters-js-indent` name and its description does not seem quite spot on, as it was already being (partially unsuccessfully) (ab?)used by some modes for which "JavaScript like"ness is a bit of a stretch :) Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-12-14Add `docformatter` which formats Python docstrings to PEP 257 (#267)Michael Eliachevitch
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>
2023-12-14Add support for `dprint` (#249)Ville Skyttä
https://dprint.dev --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-12-14Add support for kotlin-ts-mode (#270)Derek Passen
https://gitlab.com/bricka/emacs-kotlin-ts-mode
2023-12-14Add support for JSON with `python3 -m json.tool` (#257)Ville Skyttä
https://docs.python.org/3/library/json.html#module-json.tool
2023-12-14 Add support for `cljfmt` (#271)dalu
2023-12-09Log an error when a formatter's executable is not found (#269)Ibrahim Awwal
I was trying to set up a new formatter and it wasn't in my exec-path, so it wasn't running anything. But there was no message in the apheleia logs, even with `apheleia-log-debug-info` enabled. This adds a log entry when the executable is not found. Hopefully the formatting is okay - I think Apheleia re-indented it so hopefully that's good. Fixes #268 --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-12-01Use `perltidy` as default formatter for `cperl-mode` (#260)Ville Skyttä
Co-authored-by: Mohsin Kaleem <mohkale@kisara.moe>
2023-11-29Add `perltidy` indent level and line length support (#261)Ville Skyttä
2023-11-29Add denofmt (#264)dalu
2023-11-28Add support for Robot Framework files with `robotidy` (#263)Ville Skyttä
2023-11-28Changelog and obsoletion marker fixes (#262)Ville Skyttä
2023-11-26Add js-beautify based formatters (#229)Mohsin Kaleem
2023-11-23Release version 4.0v4.0Radon Rosborough
2023-11-23Add support for SQL using `pgformatter` (#247)Abdelhak Bougouffa
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> -->
2023-11-23Always supply `--stdin-filepath` to Prettier (#253)Anders Kaseorg
This is required for Prettier to pick up the correct settings from its config files. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-11-23Add note about markdown-mode (#256)Radon Rosborough
2023-11-23Spelling and grammar fixes (#248)Ville Skyttä
2023-11-23Add support for `xmllint` (#251)Ville Skyttä
<!-- 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>
2023-11-23Test against Emacs 29 instead of master (#255)Radon Rosborough
<!-- To expedite the pull request process, please see the contributor guide for my projects: <https://github.com/raxod502/contributor-guide> -->
2023-11-23Add missing changelog entry (#254)Radon Rosborough
2023-11-23Respect `typescript-indent-level`, `typescript-ts-mode-indent-offset` (#252)Anders Kaseorg
https://github.com/emacs-typescript/typescript.el/blob/v0.4/typescript-mode.el#L635-L639 https://github.com/emacs-mirror/emacs/blob/emacs-29.1/lisp/progmodes/typescript-ts-mode.el#L38-L43 --------- Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-11-23Add support for `yq` (#250)Ville Skyttä
<!-- To expedite the pull request process, please see the contributor guide for my projects: <https://github.com/raxod502/contributor-guide> -->
2023-11-17Preserve marks as well as points (#198)Sohum Banerjea
Marks are processed in almost exactly the same way as point; in particular going through exactly the same `apheleia--align-point` function. This works with minimal changes because markers act like numbers, but also can be passed to `set-marker` to mutate their state. --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-11-17Add note to changelogRadon Rosborough
2023-11-17Apply some code review suggestions from MELPA (#246)Radon Rosborough
https://github.com/melpa/melpa/pull/8809#issuecomment-1807218549
2023-11-11[#232] Format from elixir project dir (#239)Radon Rosborough
Make it so that if there is a `.formatter.exs` file somewhere in the parent directories, then Apheleia will run `mix format` from there instead of the current directory. Close #232
2023-11-11Small fixes (#245)Radon Rosborough
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.
2023-11-11Bump test environment to Ubuntu 22.04 (#242)Ed Slocomb
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.
2023-11-06move pnp-bin.js into formatters dir for simpler melpa recipe (#243)Ed Slocomb
Gets all non-elisp dependencies into a single directory, `scripts/formatters` <!-- To expedite the pull request process, please see the contributor guide for my projects: <https://github.com/raxod502/contributor-guide> -->
2023-11-05Add support for formatters locally installed via yarn 2+ pnp mode (#200)Ed Slocomb
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>
2023-11-04Fix byte-compilation order (#240)Radon Rosborough
This fixes one compilation issue, for another, see https://github.com/radian-software/apheleia/pull/237#issuecomment-1793531728
2023-11-04Add support for the ruff python formatter (#236)Chris Rose
This adds support, but does not make it the default Fixes: #233 --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-10-29[#226] Add debug logs (#235)Radon Rosborough
Adds a way to properly diagnose performance issues like those reported in https://github.com/radian-software/apheleia/issues/226.
2023-10-29[#226] Use lexical variable for saved buffer hash (#234)Radon Rosborough
Should help with https://github.com/radian-software/apheleia/issues/226 although there is a second problem related to performance also reported in that thread, which would not be helped with this. Mostly indentation changes.