nushell / nushell/nufmt

Checklist of format

Open
#13 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement meta-issue
Dominant language
Rust
Stars
230
Forks
40
Avg merge
15h 30m
Merged PRs (30d)
1

Description

Status of formatting Shapes in nufmt

FlatShape is a struct that gives me the type of contents to format. Based in this struct, the code decides how to output.
The following checklist runs down on the state of every enum case, separated in groups:

solved, no problem raised:

  • String
  • Int
  • Nothing
  • List
  • Record
  • Pipe
  • External

(partially) handled, but some problems occured:

  • ExternalArg: This FlatShape is the argument of the Extenal enum. Most of the time is a long pipeline. I didn't handle the arguments recurively yet. I don't like recursion.
  • Garbage: I don't know why this is called garbage. Usually starts with a let statement, or sometimes with a comment. Normally it grabs the first line after a comment.

remaining to handle:

This enums I haven't found them yet, or didn't tried. With further tests we'll check it.

  • And:
  • Binary:
  • Block:
  • Bool:
  • Closure:
  • Custom(DeclId):
  • DateTime:
  • Directory:
  • Filepath:
  • Flag:
  • Float:
  • GlobPattern:
  • InternalCall(DeclId) :
  • Keyword:
  • Literal:
  • MatchPattern:
  • Operator:
  • Or:
  • Range:
  • Redirection:
  • Signature:
  • StringInterpolation:
  • Table:
  • Variable(VarId):

Tasks left to do:

  • test every case at least once.
  • add automatic testing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FlatShape definition in crates/nu-parser/src/flatten.rs and inspect how nufmt currently handles the solved cases. Exercise the remaining enum variants and extend the automatic tests; done means each listed case has been tested and is formatted appropriately.

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
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.