apheleia/test/formatters/installers
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
..
asmfmt.bash Add asmfmt formatter (#168) 2023-04-22 10:26:49 +01:00
astyle.bash Add astyle formatter (#169) 2023-04-22 10:36:38 +01:00
bean-format.bash Add bean-format (#101) 2022-06-20 14:51:17 -07:00
beautysh.bash Add beautysh formatter (#170) 2023-04-22 11:34:12 +01:00
black.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
brittany.bash Fix brittany formatter & misc improvements (#222) 2023-10-06 22:01:38 -07:00
buildifier.bash Add buildifier formatter (#171) 2023-04-22 11:38:15 +01:00
caddyfmt.bash Add formatter for Caddyfile (#154) 2023-02-18 17:00:08 -08:00
clang-format.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
cmake-format.bash Add cmake-format formatter (#172) 2023-04-22 11:41:37 +01:00
crystal-tool-format.bash Add Crystal lang support. (#137) 2022-10-24 17:42:15 -07:00
dart-format.bash Dart format support (#89) 2022-05-01 14:51:27 -07:00
elm-format.bash Add elm-format (#100) 2022-09-03 10:57:40 -07:00
fish-indent.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
fourmolu.bash Add ormolu and fourmolu, remove brittany (#221) 2023-10-06 21:39:38 -07:00
gawk.bash Add gawk formatter (#187) 2023-04-20 14:33:53 +01:00
gofmt.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
gofumpt.bash use up-to-date golang (#218) 2023-10-06 21:47:52 -07:00
goimports.bash use up-to-date golang (#218) 2023-10-06 21:47:52 -07:00
google-java-format.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
hclfmt.bash Use hclfmt to format hashicorp HCL files. (#231) 2023-10-29 15:17:34 -07:00
html-tidy.bash Add html-tidy formatter (#173) 2023-04-22 11:44:44 +01:00
isort.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
jq.bash Add jq formatter (#174) 2023-04-20 13:50:03 +01:00
ktlint.bash Add ktlint (#97) 2022-05-13 09:23:57 -07:00
latexindent.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
lisp-indent.bash Add emacs-lisp formatting (#102) 2022-09-03 11:22:35 -07:00
mix-format.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
nixfmt.bash Add nixfmt (#98) 2022-05-15 21:36:47 -07:00
ocamlformat.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
ormolu.bash Add ormolu and fourmolu, remove brittany (#221) 2023-10-06 21:39:38 -07:00
perltidy.bash Add perltidy formatter (#175) 2023-04-22 11:48:38 +01:00
phpcs.bash Add phpcs & introduce scripts/formatters (#87) 2022-05-11 16:26:33 -07:00
prettier-css.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier-graphql.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier-html.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier-javascript.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier-json.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier-markdown.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier-ruby.bash Add support for formatters locally installed via yarn 2+ pnp mode (#200) 2023-11-05 12:08:58 -08:00
prettier-scss.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier-svelte.bash Add support for formatters locally installed via yarn 2+ pnp mode (#200) 2023-11-05 12:08:58 -08:00
prettier-typescript.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier-yaml.bash [#103] Specify --parser in Prettier (#107) 2022-09-10 17:24:54 -07:00
prettier.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
purs-tidy.bash Add purs-tidy formatter (#182) 2023-03-29 14:35:02 -07:00
rubocop.bash Add rubocop formatter (#176) 2023-04-22 11:53:13 +01:00
ruby-standard.bash Add ruby-standard formatter (#201) 2023-08-11 17:25:58 -07:00
ruff.bash Add support for the ruff python formatter (#236) 2023-11-04 18:23:00 +00:00
rufo.bash Add rufo formatter (#177) 2023-04-22 11:56:29 +01:00
rustfmt.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
shfmt.bash Add shfmt (#90) 2022-05-12 12:52:57 -07:00
stylua.bash Add stylua (#105) 2022-06-20 14:21:27 -07:00
terraform.bash Add formatter tests (#72) 2022-01-05 15:35:12 -08:00
yapf.bash Add yapf formatter (#196) 2023-05-27 10:55:56 -07:00