conform.nvim icon indicating copy to clipboard operation
conform.nvim copied to clipboard

feature request:

Open LeonardoMor opened this issue 1 year ago • 11 comments

Did you check existing requests?

  • [X] I have searched the existing issues

Describe the feature

Add jqfmt.

Provide background

Some times keeping our jq queries in their own file makes sense. There is an lsp for the jq language already and a formatter. It'll be great to have the formatter supported by conform.

What is the significance of this feature?

nice to have

Additional details

No response

LeonardoMor avatar May 07 '24 06:05 LeonardoMor

      formatters = {
        jqfmt = {
          command = os.getenv("XDG_DATA_HOME") .. "/go/bin/jqfmt",
          args = { "-ob", "-ar", "-op", "pipe" },
        },
    }

This config will fail with:

21:14:51[ERROR] Formatter 'jqfmt' error: time="2024-07-06T21:14:51+03:00" level=fatal msg="could not read file: open /dev/stdin: no such device or address"

Leaving this here for reference.

ervinpopescu avatar Jul 06 '24 18:07 ervinpopescu

PR opened upstream: https://github.com/noperator/jqfmt/pull/3

ervinpopescu avatar Jul 07 '24 15:07 ervinpopescu

PR opened upstream: noperator/jqfmt#3

Cool. Hopefully it gets merged.

LeonardoMor avatar Jul 07 '24 19:07 LeonardoMor

Merged upstream PR ✅

noperator avatar Aug 15 '24 16:08 noperator

Beautiful

LeonardoMor avatar Aug 15 '24 22:08 LeonardoMor

@LeonardoMor I don't think we need this issue anymore, should we close it? conform doesn't need to support jq/jqfmt directly, it could just be a custom formatter.

ervinpopescu avatar Aug 19 '24 05:08 ervinpopescu

True. But the same can be said about the other formatters

LeonardoMor avatar Aug 19 '24 19:08 LeonardoMor

I guess so, @stevearc should make the call then.

ervinpopescu avatar Aug 20 '24 19:08 ervinpopescu

Alternatively, we could send a PR. Are there any guidelines to do so? Or to add a formatter to conform so that it is available to config out of the box?

LeonardoMor avatar Aug 28 '24 22:08 LeonardoMor

Nevermind. Might not be ready for general use. See here

LeonardoMor avatar Aug 28 '24 23:08 LeonardoMor

That is indeed one of the things I ran into as well.

ervinpopescu avatar Aug 29 '24 11:08 ervinpopescu