nushell / nushell/nushell

Allow dates and filesizes to be converted to headers by `group-by` (and `headers`, I suppose)

Open
#7,167 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A:type-system category:enhancement semantics
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Related problem

No response

Describe the solution you'd like

The main reason I want this is so that ls | group-by size (and such) can "just work" without needing to explicitly convert the entire column to string. I think this is appropriate because filesizes and dates are both "numeric-ish" types that aren't complex or ambiguous to serialise (unlike data structures, closures, etc).

To turn these to headers, these values should be converted to their to nuon serialisation, which are unambiguous representations unhindered by the user's config or any relative rendering.

I don't really care about headers that much, but, since it now has type-checking (#6918) I think these commands should both have consistency in what types are "header-able". (Desirable Idea: try and abstract this out and make "can_be_header" a method of Value. Maybe don't call it that exactly, though…)

Describe alternatives you've considered

No response

Additional context and details

No response

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 by tracing the group-by and headers commands, including the type-checking work in issue #6918. Check how ls | group-by size currently handles dates and filesizes, then verify that both commands consistently accept these values and convert them using their to nuon serialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.