Describe the bug
I have a shell command written in nu that has a shebang at the top. I cannot get nufmt to format this file unless I rename it to *.nu or I use the --stdin flag.
|
fn is_nu_file(entry: &DirEntry) -> bool { |
|
entry.file_type().map(|ft| ft.is_file()).unwrap_or(false) |
|
&& entry.path().extension().is_some_and(|ext| ext == "nu") |
|
} |
Steps To Reproduce
Steps to reproduce the behavior:
- Have nu file without the
.nu file extension such as my-command
- Run
nufmt my-command
- Observe error "warning: no Nushell files found under the given path(s)⏎"
Expected behavior
I expect nufmt to format the file because I specified the file on the CLI.
Environment
Please run rustc --version and paste the result.
[user@system:~]$ rustc --version
rustc 1.91.1 (ed61e7d7e 2025-11-07)
Describe the bug
I have a shell command written in nu that has a shebang at the top. I cannot get nufmt to format this file unless I rename it to
*.nuor I use the--stdinflag.nufmt/src/main.rs
Lines 319 to 322 in 3596222
Steps To Reproduce
Steps to reproduce the behavior:
.nufile extension such asmy-commandnufmt my-commandExpected behavior
I expect nufmt to format the file because I specified the file on the CLI.
Environment
Please run
rustc --versionand paste the result.