aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
2026-04-21Check changelog properlyHEADmainRadon Rosborough
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-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)
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-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-02Fix `apheleia-npx` in Yarn PnP projects (#301)Xandor Schiefer
* `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>
2024-03-30Prevent null issues when strings are unequal (#290)Ellis Kenyő
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>
2024-03-02Add changelog linter (#287)Radon Rosborough
This should help make sure we don't forget to document any important user-visible changes.
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 `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-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-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>
2022-09-03Add emacs-lisp formatting (#102)Ellis Kenyő
* feat: add emacs-lisp formatting * Disable indent-tabs-mode * Add stub file for installation * Fix lint errors * fix: correctly format based on previous mode * Formatting * Fix weird indent * Add checkindent target * Update changelog * Long line * Empty commit * fix ci * revert changelog reformatting * more changelog * more Co-authored-by: Radon Rosborough <radon.neon@gmail.com> Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2022-05-11Add phpcs & introduce scripts/formatters (#87)Ellis Kenyő
* feat: add phpcs & introduce scripts/formatters Add phpcs as a supported formatter, and include support for apheleia-defined scripts for more troublesome formatters * Revert Emacs version requirement * More quoting * Adjust language in documentation * Thanks checkdoc, lol Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2022-01-05Add formatter tests (#72)Radon Rosborough
Closes #24 Builds on #25 by @PrimaryCanary
2022-01-03Port longlines checker from CTRLFRadon Rosborough
2021-04-04Remove unneeded checkRadon Rosborough
2019-11-16Migrate from Semaphore CI to CircleCIRadon Rosborough
2019-07-10Add Docker and improve MakefileRadon Rosborough