Automattic / Automattic/harper

Flag inflected verb forms after the infinitive particle "to"

Open
#993 2 comments 0 reactions 1 assignee Claimed by @hippietrail View on GitHub
enhancement harper-core linting
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

## Description

I just spotted this mistake in a comment in our source:
```
/// A location-agnostic structure that attempts to captures the context and content that a [`Lint`]
/// occurred.
```
This probably came from editing "that captures" to "that attempts to capture".
This is probably a common occurrence so worth our while to fix.

From the wide arrange of false positives listed below, it looks like the 3rd person singular present (the "-s" form) of the verb is the only relatively trivial one to identify.

## Examples

- A location-agnostic structure that attempts **to captures** the context and content that a Lint occurred.
- Whiteboard shape causes recording actor **to dies**
- Add linter **to finds** structures with uninitialized fields

## Potential False Positives

Many! "To" is a word with many uses.

- It's a preposition, which comes before nouns, and verbs with the `-ing` inflection are gerunds, which function as nouns
- Is this a viable solution **to finding** all types of Flat Config?
- The `-ing` inflection is also the present participle, which functions as an adjective, which can occur between the preposition "to" and a noun:
- Cannot write to **closing transport**
- The `-ed` inflection makes a verb a past participle, which functions as an adjective:
- sending data **to closed** connection
- Adjectives, including past participles, can sometimes be used as "implied nouns":
- If it exists how do I default it **to closed**, if not can it be implemented?
- Verbs in the third person singular present may have the same form as a plural noun:
- Error due **to reads** >30000nt

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.