Automattic / Automattic/harper
`Sentence`-based `ExprLinter`s lack the caching support of `Chunk`-based ones.
- Dominant language
- Rust
- Stars
- 15.4k
- Forks
- 627
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 106
Description
In `lint_group.rs` we can add linters in three ways:
- Call `add()` manually.
- Call `add_chunk_expr_linter()`.
- Use the `insert_struct_rule` macro. This calls `add()`
- Use the `insert_expr_rule` macro. This calls `add_chunk_expr_linter()`
Since `add_chunk_expr_linter()` specifically works only for the `Chunk` `Unit` and provides caching that `ExprLinter`s use for efficieny, this leaves no way for an `ExprLinter` that uses `Sentence` to make use of caching.
At the moment there are no such linters but I'm exploring linters which look for semantic context by checking all words in the surrounding sentence context against a list of keywords.
This does work with `add()` but will not benefit from caching.
I briefly looked at adding it but it seems to be more involved than I expected, so filing this instead since I might move on to other problems.
Contributor guide
Research direction
Start in lint_group.rs by comparing add() with add_chunk_expr_linter() and tracing how insert_struct_rule and insert_expr_rule invoke them. Determine how caching is provided for Chunk-based ExprLinter instances and define the equivalent behavior for Sentence-based ones; done means a Sentence ExprLinter can use caching without losing its surrounding-sentence context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100