sqlfmt icon indicating copy to clipboard operation
sqlfmt copied to clipboard

sqlfmt + reviewdog

Open ryaminal opened this issue 2 years ago • 2 comments

Curious if anyone has used sqlfmt with reviewdog. A pretty nifty tool that automatically creates PR comments for format changes.

It likely won't be too tricky to get it to work, but thought I'd ask everyone if it has already been done and potentially document here for future users.

ryaminal avatar Dec 05 '23 20:12 ryaminal

Not that I know of; I'd love to hear how it goes for you.

sqlfmt produces something very close to "unified diff" with the --diff option, so it might just work? I had never heard of ReviewDog, but had a similar thought in #259; the API seemed tough so I deprioritized it, though. If reviewdog is easy to set up I'd love to add that to the docs.

And if you want to open a PR here with changes to --diff (or a new option) that outputs a format for reviewdog, I'd welcome that contribution.

tconbeer avatar Dec 05 '23 22:12 tconbeer

Excellent. We've only recently learned about reviewdog and it's pretty slick with github PRs and stuff.

Reviewdog supports a few formats, but we'll try it with plain --diff output and hope that works. If not we can explore a sarif or rdjson flag in sqlfmt, perhaps.

Thanks for the response. Will update this ticket when we have next steps.

ryaminal avatar Dec 05 '23 22:12 ryaminal