Skip to content

Add deprecation warning for bare invocation of nixfmt#376

Merged
jfly merged 2 commits intoNixOS:masterfrom
ashwinmathi:master
Mar 18, 2026
Merged

Add deprecation warning for bare invocation of nixfmt#376
jfly merged 2 commits intoNixOS:masterfrom
ashwinmathi:master

Conversation

@ashwinmathi
Copy link
Copy Markdown
Contributor

@ashwinmathi ashwinmathi commented Mar 17, 2026

Added warning: Bare invocation of nixfmt is deprecated. Use 'nixfmt -' for anonymous stdin.

This closes #301

Warning: Bare invocation of nixfmt is deprecated. Use 'nixfmt -' for anonymous stdin.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

Nixpkgs diff

Copy link
Copy Markdown
Contributor

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick PR!

I just have a couple minor nits w.r.t. the ANSI text formatting, otherwise diff SGTM. Tested locally, and the warning appears as intended.

$ echo '{ foo = "bar"; }' | result/bin/nixfmt -
{ foo = "bar"; }

$ echo '{ foo = "bar"; }' | result/bin/nixfmt
Warning: Bare invocation of nixfmt is deprecated. Use 'nixfmt -' for anonymous stdin.
{ foo = "bar"; }

Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
Copy link
Copy Markdown
Collaborator

@jfly jfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jfly jfly enabled auto-merge March 18, 2026 00:43
@ashwinmathi
Copy link
Copy Markdown
Contributor Author

ashwinmathi commented Mar 18, 2026

I'll make a new PR with the error and warning stuff cleaned up, those escape codes are elsewhere in the repo I'll get em all

@jfly jfly merged commit d1fdeb7 into NixOS:master Mar 18, 2026
2 checks passed
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.

nixfmt without args waits indefinetely for stdin

3 participants