bram209 / leptosfmt

A formatter for the leptos view! macro
Apache License 2.0
272 stars 29 forks source link

Add pre-commit hook #150

Open huuff opened 1 month ago

huuff commented 1 month ago

Hi, thanks for making leptosfmt!

I usually like formatters in pre-commit hooks in addition to editors, rather than in CI. This PR enables that for leptosfmt using the pre-commit framework.

Pre-commit doesn't allow building workspace rust projects, which severely limits the usability of the rust type. The usual workaround (as seen in this issue) is to just use a docker type. So I also added a Dockerfile that builds and runs leptosfmt which I hope can be useful for more than just pre-commit.

I also added a very short section to the readme with usage instructions.

I`m happy to follow up with any required changes