This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
D401: Allow multiple imperative forms of the same stem. (#382)
* Allow multiple imperative forms of the same stem. * Update phrasing of violation. * Select best imperative by longest prefix match * Fixed test after merge. * Added line to release notes. * Code review fixes.
- Loading branch information
Showing
9 changed files
with
93 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Unit test for pydocstyle utils. | ||
Use tox or py.test to run the test suite. | ||
""" | ||
from pydocstyle import utils | ||
|
||
|
||
__all__ = () | ||
|
||
|
||
def test_common_prefix(): | ||
"""Test common prefix length of two strings.""" | ||
assert utils.common_prefix_length('abcd', 'abce') == 3 | ||
|
||
|
||
def test_no_common_prefix(): | ||
"""Test common prefix length of two strings that have no common prefix.""" | ||
assert utils.common_prefix_length('abcd', 'cdef') == 0 | ||
|
||
|
||
def test_differ_length(): | ||
"""Test common prefix length of two strings differing in length.""" | ||
assert utils.common_prefix_length('abcd', 'ab') == 2 | ||
|
||
|
||
def test_empty_string(): | ||
"""Test common prefix length of two strings, one of them empty.""" | ||
assert utils.common_prefix_length('abcd', '') == 0 |