Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit ee4e264

Browse files
committed
Update phrasing of violation.
1 parent af5bb1f commit ee4e264

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/pydocstyle/violations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def to_rst(cls) -> str:
219219
D400 = D4xx.create_error('D400', 'First line should end with a period',
220220
'not {0!r}')
221221
D401 = D4xx.create_error('D401', 'First line should be in imperative mood',
222-
"'{0}', not '{1}'")
222+
"perhaps '{0}', not '{1}'")
223223
D401b = D4xx.create_error('D401', 'First line should be in imperative mood; '
224224
'try rephrasing', "found '{0}'")
225225
D402 = D4xx.create_error('D402', 'First line should not be the function\'s '

src/tests/test_cases/noqa.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def docstring_bad_ignore_one(): # noqa: D400,D401,D415
1616
pass
1717

1818

19-
@expect("D401: First line should be in imperative mood ('Run', not 'Runs')")
19+
@expect("D401: First line should be in imperative mood "
20+
"(perhaps 'Run', not 'Runs')")
2021
def docstring_ignore_some_violations_but_catch_D401(): # noqa: E501,D400,D415
2122
"""Runs something"""
2223
pass

src/tests/test_cases/sections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def ignore_non_actual_section(): # noqa: D416
177177

178178
@expect(_D213)
179179
@expect("D401: First line should be in imperative mood "
180-
"('Return', not 'Returns')")
180+
"(perhaps 'Return', not 'Returns')")
181181
@expect("D400: First line should end with a period (not 's')")
182182
@expect("D415: First line should end with a period, question "
183183
"mark, or exclamation point (not 's')")

src/tests/test_cases/test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ def lwnlkjl():
287287
"""Summary"""
288288

289289

290-
@expect("D401: First line should be in imperative mood ('Return', not "
291-
"'Returns')")
290+
@expect("D401: First line should be in imperative mood "
291+
"(perhaps 'Return', not 'Returns')")
292292
def liouiwnlkjl():
293293
"""Returns foo."""
294294

@@ -361,7 +361,8 @@ def inner_function():
361361

362362

363363
@expect("D400: First line should end with a period (not 'g')")
364-
@expect("D401: First line should be in imperative mood ('Run', not 'Runs')")
364+
@expect("D401: First line should be in imperative mood "
365+
"(perhaps 'Run', not 'Runs')")
365366
@expect("D415: First line should end with a period, question mark, "
366367
"or exclamation point (not 'g')")
367368
def docstring_bad():
@@ -379,7 +380,8 @@ def docstring_bad_ignore_one(): # noqa: D400,D401,D415
379380
pass
380381

381382

382-
@expect("D401: First line should be in imperative mood ('Run', not 'Runs')")
383+
@expect("D401: First line should be in imperative mood "
384+
"(perhaps 'Run', not 'Runs')")
383385
def docstring_ignore_some_violations_but_catch_D401(): # noqa: E501,D400,D415
384386
"""Runs something"""
385387
pass

0 commit comments

Comments
 (0)