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

treefmt2 doesn't search for the project root anymore #308

Closed
zimbatm opened this issue May 30, 2024 · 0 comments · Fixed by #309
Closed

treefmt2 doesn't search for the project root anymore #308

zimbatm opened this issue May 30, 2024 · 0 comments · Fixed by #309
Labels
bug Something isn't working

Comments

@zimbatm
Copy link
Member

zimbatm commented May 30, 2024

Describe the bug

When running treefmt in a sub-folder, it only formats that folder.

treefmt1 was walking up to find the treefmt.toml and then using that as the default TreeRoot variable. This was convenient because you can easily format the whole project from any place in the tree. And if you want to only format the current folder you can still run treefmt .

To Reproduce

Steps to reproduce the behavior:

  1. ...
  2. ...

Expected behavior

System information

Additional context

@zimbatm zimbatm added the bug Something isn't working label May 30, 2024
zimbatm added a commit that referenced this issue May 30, 2024
When not specified, look for the tree root based on the location of the
config file.

Fixes #308

The --tree-root-file option will be useful to replace this bash wrapper: https://github.com/numtide/treefmt-nix/blob/2fba33a182602b9d49f0b2440513e5ee091d838b/module-options.nix#L116-L135
zimbatm added a commit that referenced this issue May 30, 2024
Restore the treefmt 1.x behaviour where it would search for the tree
root by recursively searching for the treefmt.toml file up the
filesystem, starting from the current directory.

The `--tree-root-file` option will be useful to remove this bash wrapper: https://github.com/numtide/treefmt-nix/blob/2fba33a182602b9d49f0b2440513e5ee091d838b/module-options.nix#L116-L135

Fixes #308
@mergify mergify bot closed this as completed in #309 May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant