Skip to content

feat: more formatters#43

Merged
glepnir merged 10 commits intonvimdev:mainfrom
barrettruth:main
Aug 11, 2023
Merged

feat: more formatters#43
glepnir merged 10 commits intonvimdev:mainfrom
barrettruth:main

Conversation

@barrettruth
Copy link
Copy Markdown
Contributor

@barrettruth barrettruth commented Aug 9, 2023

Add some more formatters.

Did not write tests (yet?) but obviously tested the formatters themselves.

Also, sql-formatter doesn't seem to work with stdin = true (although it does work with null-ls as shown here). Had to resort to the config I wrote which edits in-place (which should be fine).

Comment thread lua/guard/tools/formatter.lua Outdated
@barrettruth
Copy link
Copy Markdown
Contributor Author

Can you add how to run tests to the documentation for contributing? I only have a little experience with busted.

Comment thread lua/guard/tools/formatter.lua
@glepnir
Copy link
Copy Markdown
Member

glepnir commented Aug 10, 2023

Testing these tools is a bit troublesome. Need curl or wget to install them and add to environment variables. Then write some test cases . but the priority is lower. can write a general helper to complete these operations in the future

@barrettruth
Copy link
Copy Markdown
Contributor Author

Ok. May work on that in coming days.

@glepnir
Copy link
Copy Markdown
Member

glepnir commented Aug 11, 2023

could you add them into readme

@barrettruth
Copy link
Copy Markdown
Contributor Author

done

@barrettruth
Copy link
Copy Markdown
Contributor Author

Should I just add as many sources from null-ls builtin formatters as possible until a way to figure out testing is discovered?

null-ls itself doesn't even test for formatting but it does for diagnostics - I think the latter is complex as you stated.

@glepnir
Copy link
Copy Markdown
Member

glepnir commented Aug 11, 2023

I think it needs to be kept simple enough. Necessary for very common additions to builtins. For something rare I think it's better to add in local config. Avoid plugin bloat.

@glepnir
Copy link
Copy Markdown
Member

glepnir commented Aug 11, 2023

good enough now. thanks

@glepnir glepnir merged commit 44c5ada into nvimdev:main Aug 11, 2023
@glepnir glepnir mentioned this pull request Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants