ls: [cleanup] each column to keep track of its own width
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
From https://github.com/uutils/coreutils/issues/10980#issuecomment-4232741589:
I find it really unclean, hacky code that if there's more space needed for the permissions (due to some ACLs) then you keep track of it by increasing the padding of link count, the next field.
Such approach is semantically bad, and will break if you ever add various other output formats (let alone the possibility of user-defined list of columns).
In clean code, each property should keep track of its own required width.
Maybe you want to refactor this part?
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 locating the ls output-formatting code that calculates column widths, then trace how extra permission width currently affects the link-count field. Refactor the width tracking so each property owns its required width, and verify that existing ls output and tests remain correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100