Open wedi opened 3 years ago
Hi @wedi
Thanks for your input.
Do I understand correct that you are requesting the option "--write" which executes the formatting based on a glob matching patterns? Like prettier does?
Exactly. That would make things much tidier.
--check
is nice to have, too, but you could work arround that with git diff --exit-code
.
@wedi It will be a bit more work, since I would have to scan folders for patterns.
I understand the local usage use case for ---write
Maybe you could use a library for that, e.g. https://www.npmjs.com/package/glob
This would be extremely helpful.
You don't even have to implement the globbing as a first step.
Just doing npx openapi-format --write *.yaml
and npx openapi-format --check *.yaml
in the CI without any output format would things make easier.
hi @wedi & @bodograumann
Although it is not exactly the feature requested, in release v1.23.0, we introduced the support for .openapiformatrc
which allows you to define all openapi-format options in 1 file, that will be automatically picked up.
Hi, first of all, thanks for your tool that helps keeping API definitions and commits clean. ❤️
prettier
has a CLI that makes it really easy to use it in scripts, e.g. inCI
:--write
replaces the input files--check
makes it fail if something changedThat might be a nice addition to
openapi-format
, too, although you can work arround the first two withfind . -name '*.yaml' -exec yarn run openapi-format {} -o {} \;
.