Linter idea: strange combinations of indexing and `dig`
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Rust
- Stars
- 355
- Forks
- 24
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 17
Description
When we can support type-aware expression auto-correction, it would be nice to rewrite this:
a.first.dig(:a, :b)
a[0].dig(:a, :b)
Into:
a.dig(0, :a, :b)
Likewise for second, third, etc. (though maybe not last, a.dig(-1, :a, :b) works, but it's not very clear).
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 with the issue's examples of indexing, first, second, and third combined with dig. Locate the type-aware expression auto-correction entry point, then determine how the proposed rewrites should be recognized and when they are safe; done means the supported combinations are corrected while ambiguous cases such as last are handled deliberately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100