-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-lintArea: New lintsArea: New lints
Description
What it does
This lint suggests to end a sentence with punctuation if there is a newline gap, (two \n\n
) or the doc comment ends.
Lint Name
puncuate_end_sentence
Category
pedantic
Advantage
- Documentation is made clearer with punctuation at the end of short sentences and long paragraphs.
Drawbacks
- This lint only works for the end of documentation or where a new line gap is present. Otherwise we would have to embed a grammar engine into clippy.
- This lint is not easily applicable in languages that are not descended from Latin (hence the pedantic category).
Example
/// Returns the meaning of life
fn meaning_of_life() -> u32 {
42
}
Could be written as:
/// Returns the meaning of life.
fn meaning_of_life() -> u32 {
42
}
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lints