official style guide for nushell script files and `nufmt` to auto-format such input
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 40.5k
- Forks
- 2.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 85
Description
Related problem
I'd like to write .nu script files and have white-space and other stylistic concerns handled for me in a consistent way
For a start, looking at the contributed scripts here ( https://github.com/nushell/nu_scripts ) I can see they are indented with varying numbers of spaces
Describe the solution you'd like
-
a first-party statement regarding recommended code style for nushell scripts, whether that be one line that says "as much as possible, do whatever upstream Rust does" or something more specific to nushell
-
offer a first-party utility similar to
gofumpt,rustfmt, orprettierthat handles not just indentation and spaces between tokens, but is also opinionated about line-length and thus also auto-line-breaks (just like these other 3x tools do for their own target formats)
Describe alternatives you've considered
The status quo is honestly not urgent or even an inconvenience, I just like opinionated first-party code style guides :)
For now, I can just do whatever I like in my nushell code style no matter how different it is to other nushell scripts
Additional context and details
Thanks so much for working on nushell and sharing it, it's been exciting and fun to follow along and try it out
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue mentions contributed scripts in the nu_scripts repository but names no nushell source files, tests, or formatter entry point. Start by reviewing those scripts and the existing formatting approaches it references; done would require an agreed Nushell style guide and a first-party formatter covering whitespace, token spacing, line length, and line breaks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100