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

feat: format the current directory by default #252

Closed
wants to merge 1 commit into from

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Sep 11, 2024

The common case is to format folders, not stdin.

This changes the default to format the current directory, and introduces
a --stdin flag for users that want to wrap nixfmt into editors and
other tools.

See also NixOS/nix#11438

The common case is to format folders, not stdin.

This changes the default to format the current directory, and introduces
a `--stdin` flag for users that want to wrap `nixfmt` into editors and
other tools.

See also NixOS/nix#11438
Copy link

github-actions bot commented Sep 11, 2024

Nixpkgs diff

@infinisil
Copy link
Member

It looks like you're unaware of #240, where we deprecated directory recursing in favor of treefmt taking care of that. I'm not yet 100% sure on the interactions with your PRs 🤔

@zimbatm
Copy link
Member Author

zimbatm commented Sep 11, 2024

Indeed. With that direction in mind, I think we can drop this PR 👍

@zimbatm zimbatm closed this Sep 11, 2024
@Kamillaova
Copy link

It looks like you're unaware of #240, where we deprecated directory recursing in favor of treefmt taking care of that. I'm not yet 100% sure on the interactions with your PRs 🤔

imagine spawning millions of processes instead of one 😍

@piegamesde
Copy link
Member

Please save your snark for elsewhere. Nixfmt of course still accepts passing multiple files via CLI arguments, as is common practice in such applications. It is up to the caller to do the right thing.

@infinisil
Copy link
Member

Well said @piegamesde, thanks

Also, last time I touched treefmt, it only used a single process per 1024 files. It went through a rewrite by now, so I'm not sure if that's still the case, but if it's not that sounds like something to fix.

@Kamillaova
Copy link

Okay, thanks
If treefmt used one process before, I think it works the same way now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants