questions about intended behaviour regarding comments and empty lines
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 230
- Forks
- 40
- Avg merge
- 15h 30m
- Merged PRs (30d)
- 1
Description
Thanks so much for sharing this project! <3
I am testing this commit: https://github.com/nushell/nufmt/commit/4d578493d937c0b49bfd7f1c29a903e642732ab3
Test cases:
nufmt --stdin "# hello\n\n\nlet foo = 'abc'\n\n\n# goodbye"
output:
# hello
let foo = 'abc'
# goodbye
nufmt --stdin "# hello\n\n\n# goodbye"
output:
# hello
# goodbye
I understand the experimental/early nature of this project, and I'm a huge fan of nu, so I'm curious about what idiomatic code looks like regarding comments and empty lines:
- should
nufmtpreserve all empty lines, or is it idiomatic to have gaps no larger than a single empty line? - is it idiomatic to have "floating comments" that have one or more empty lines between them and the nearest code?
- is it idiomatic to have multiple "floating comments" in a sequence, separated by one or more empty lines?
- is it idiomatic for all comments to always be anchored to the next nearest code (e.g. no empty lines in between)?
Cheers! <3
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
Start by reproducing the two nufmt --stdin examples from the issue at commit 4d578493d937c0b49bfd7f1c29a903e642732ab. Read the formatter behavior around comments and empty lines and review the comment thread for an agreed convention. The issue is done only once the intended behavior is decided and captured in an implementation or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100