Commit graph

12 commits

Author SHA1 Message Date
Nolan
93f7480c96
Add ruby-syntax-tree format support (#224)
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-21 20:34:11 -07:00
Michael Eliachevitch
4a87523f80
Add docformatter which formats Python docstrings to PEP 257 (#267)
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-14 18:46:12 -08:00
Radon Rosborough
ddea9bea70
[#232] Format from elixir project dir (#239)
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-11 16:32:40 -08:00
Ed Slocomb
314af56e8d
move pnp-bin.js into formatters dir for simpler melpa recipe (#243)
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-06 18:02:09 -08:00
Ed Slocomb
54a192c345
Add support for formatters locally installed via yarn 2+ pnp mode (#200)
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-05 12:08:58 -08:00
Ellis Kenyő
9b745df2fa
Add emacs-lisp formatting (#102)
* 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-09-03 11:22:35 -07:00
Ellis Kenyő
982df5a2e0
Add phpcs & introduce scripts/formatters (#87)
* 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-05-11 16:26:33 -07:00
Radon Rosborough
53f243b111
Add formatter tests (#72)
Closes #24
Builds on #25 by @PrimaryCanary
2022-01-05 15:35:12 -08:00
Radon Rosborough
a606d59c2d Port longlines checker from CTRLF 2022-01-03 20:07:29 -08:00
Radon Rosborough
876078f473 Remove unneeded check 2021-04-04 11:10:01 -07:00
Radon Rosborough
68d8755333 Migrate from Semaphore CI to CircleCI 2019-11-16 22:01:04 -08:00
Radon Rosborough
9ed9d2760d Add Docker and improve Makefile 2019-07-10 22:06:18 -07:00