This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from toroettg/MultiLineStyleOption
Optional checks for multi-line docstring summary style.
- Loading branch information
Showing
7 changed files
with
194 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
"""Module to check different multi-line docstring flavors.""" | ||
|
||
from .expected import Expectation | ||
|
||
expectation = Expectation() | ||
expect = expectation.expect | ||
|
||
_D212 = 'D212: Multi-line docstring summary should start at the first line' | ||
_D213 = 'D213: Multi-line docstring summary should start at the second line' | ||
|
||
_D300 = 'D300: Use """triple double quotes""" (found \'\'\'-quotes)' | ||
_D301 = 'D301: Use r""" if any backslashes in a docstring' | ||
|
||
|
||
@expect(_D212) | ||
def multi_line_starts_second_line(): | ||
""" | ||
Summary. | ||
Description. | ||
""" | ||
|
||
|
||
@expect(_D212) | ||
@expect(_D300) | ||
def multi_line_starts_second_line_single_quote(): | ||
''' | ||
Summary. | ||
Description. | ||
''' | ||
|
||
|
||
@expect(_D212) | ||
def multi_line_starts_second_line_raw(): | ||
r""" | ||
Summary. | ||
Description with \backslash\. | ||
""" | ||
|
||
|
||
@expect(_D212) | ||
@expect(_D301) | ||
def multi_line_starts_second_line_upper_raw(): | ||
R""" | ||
Summary. | ||
Description with \backslash\. | ||
""" | ||
|
||
|
||
@expect(_D212) | ||
@expect(_D300) | ||
def multi_line_starts_second_line_raw_single_quote(): | ||
r''' | ||
Summary. | ||
Description with \backslash\. | ||
''' | ||
|
||
|
||
@expect(_D212) | ||
@expect(_D300) | ||
@expect(_D301) | ||
def multi_line_starts_second_line_upper_raw_single_quote(): | ||
R''' | ||
Summary. | ||
Description with \backslash\. | ||
''' | ||
|
||
|
||
@expect(_D213) | ||
def multi_line_starts_first_line(): | ||
"""Summary. | ||
Description. | ||
""" | ||
|
||
|
||
@expect(_D213) | ||
@expect(_D300) | ||
def multi_line_starts_first_line_single_quote(): | ||
'''Summary. | ||
Description. | ||
''' | ||
|
||
|
||
@expect(_D213) | ||
def multi_line_starts_first_line_raw(): | ||
r"""Summary. | ||
Description with \backslash\. | ||
""" | ||
|
||
|
||
@expect(_D213) | ||
@expect(_D301) | ||
def multi_line_starts_first_line_upper_raw(): | ||
R"""Summary. | ||
Description with \backslash\. | ||
""" | ||
|
||
|
||
@expect(_D213) | ||
@expect(_D300) | ||
def multi_line_starts_first_line_raw_single_quote(): | ||
r'''Summary. | ||
Description with \backslash\. | ||
''' | ||
|
||
|
||
@expect(_D213) | ||
@expect(_D300) | ||
@expect(_D301) | ||
def multi_line_starts_first_line_upper_raw_single_quote(): | ||
R'''Summary. | ||
Description with \backslash\. | ||
''' |
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