-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github action formatter #312
Comments
I am looking into this. I think it should not be too difficult to do. @zimbatm have you put any effort into it yet? Edit: Small wrinkle. So making the action itself is pretty trivial, but I realized that the main crux is the formatters. As |
I haven't touched this yet. I was going to look at https://github.com/goreleaser/goreleaser-action for inspiration, but this one is probably much simpler. The user is responsible for the dependencies. They might rely on the ones that come with the GitHub action environment. Or install the formatters in a previous step before invoking the treefmt-action step to install and run treefmt. |
I can see users installing formatters using nix (via some previous install nix action), or just a simple We should have a few examples to help people kick start things with the more popular formatters. |
I was going down the path of using nix and having the action accept a list of formatters, which would be installed at runtime. I like your idea better of just having the user responsible for installing them prior the |
Alright, here's my first crack at the action: treefmt-action. I tested it with act and it all works nicely. I also have a test.yml workflow that uses the action. The default uses |
Nice. @isbecker I did notice this:
I'm only just realising there are no windows artefacts in the releases. @zimbatm, was this just an oversight when configuring go-releaser or was there any issue? |
@isbecker nice! Thanks for working on this. The lack of Windows releases is an oversight. Windows support has yet to be thoroughly tested and might have some issues. |
@zimbatm @brianmcgee Do you think that the I noticed that there is no longer a top-level |
We're defining the formatter using https://github.com/numtide/treefmt-nix. Then, blueprint automatically creates a check. We could emit the |
On the plus side, it would ensure that treefmt-action is exercised. On the negative side, it will probably complicate maintenance by creating a circular dependency. |
We could configure it on the new docs repo to avoid the circular dependency. We could also use a |
I see, so no need for it.
Sure, it doesn't seem necessary for the
Makes sense. I was mostly wondering if there's any further action on the issue that I might be able to help with. Let me know if you would like me to look into setting it up for the docs repo. |
Next step is to make it more visible.
|
Can do. Do you want a new section in the README under the IDE integration section? Also, I can add it to the treefmt-docs repo or to this one.
Meaning in the
Already available 🙂 |
Is your feature request related to a problem? Please describe.
There is no easy to to run treefmt inside of github actions without using nix.
Describe the solution you'd like
Provide a github action that installs and invokes treefmt on the current repo.
Describe alternatives you've considered
Create a
curl | sh
installer.Additional context
The text was updated successfully, but these errors were encountered: