Skip to content

Flag inflected verb forms after the infinitive particle "to" #993

@hippietrail

Description

@hippietrail

Description

I just 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions