Skip to content
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

treefmt settings do not include config or configPath #436

Open
JayRovacsek opened this issue Apr 19, 2024 · 2 comments
Open

treefmt settings do not include config or configPath #436

JayRovacsek opened this issue Apr 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@JayRovacsek
Copy link

Currently the treefmt hook does not support a configuration path option that would enable the reference of treefmt.toml. Without running treefmt --init or --config-file the check cannot be utilised in a consistent way if the config file is not committed to the repository

Happy to contribute a PR that adds this if deemed suitable 🙏

@roberth
Copy link
Contributor

roberth commented Apr 19, 2024

The flake-parts module has a special integration that activates when you load both git-hooks.nix and treefmt-nix. Might that help?

It's defined here:

hooks.treefmt.package = lib.mkIf (options?treefmt) (lib.mkOverride 900 config.treefmt.build.wrapper);

@JayRovacsek
Copy link
Author

Thanks for the fast response @roberth, unfortunately I don't utilise flake-parts myself (though I might be misunderstanding how I'd consume the flakeModule code)

Would the project be open to a PR that added a setting for config/configFile akin to the implementation for typos? (ref)

@sandydoo sandydoo added the enhancement New feature or request label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants