-
Notifications
You must be signed in to change notification settings - Fork 339
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
Integrate treefmt-nix #533
Comments
@zimbatm do you think this is a good idea? |
Sounds good! Probably the integration can be done similar to https://github.com/numtide/treefmt-nix/blob/main/flake-module.nix |
The perfect combination of nix flake + devenv + direnv saves 90% of the development environment configuration time for newcomers who have just entered the project. After integrating treefmt, it will further increase to 99%. The last 1% will be implemented in treefmt to "watch file changes and automate formats" obtained after the features. |
I took care of this integration in my last PR. Let me know if anything needs to be changed. |
treefmt
is a CLI tool to format all files in a repository. It recurses through a directory and calls the right formatter based on the type of file it finds.treefmt
requires a configuration file that tells it what to execute for each file type. It doesn't include this configuration by default, so it takes some time to get the configuration right and requires knowledge of the different kinds of formatters that you'd like the use. Knowledge like which CLI flags to use.treefmt-nix
is a Nix module system to build a treefmt configuration. It includes options for most of the different formatters and allows just enabling them. The same kind of module system devenv uses.For instance:
It would be nice if this could be integrated into devenv, so that you could have options in devenv like:
This probably requires adding treefmt-nix as a Nix flake input to devenv. Is this something we'd want?
The text was updated successfully, but these errors were encountered: