-
-
Notifications
You must be signed in to change notification settings - Fork 8
Make SplitSummaryAndDocstringFormatter non-optional
#94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
be9031f
Update beginning_quotes test output
DanielNoord 6fa84d4
Update multi_line test output
DanielNoord ec1a10a
Update quotes_type test output
DanielNoord 1ebad21
Update whitespace_stripper test output
DanielNoord 316ab4a
Update linewrap_summary test output
DanielNoord 2a780a8
Update capitalization_first_letter test output
DanielNoord c8d2b48
Update final_period test output
DanielNoord a5504d6
Remove ``--split-summary-body`` from ``.args`` files
DanielNoord 27f4493
Update test output in unittests
DanielNoord b3a21e5
Strip whitespaces before doing any other formatting
DanielNoord 7c6f8c8
Add an ``is_rst_title`` utility function
DanielNoord 100aa56
Make ``SplitSummaryAndDocstringFormatter`` non-optional
DanielNoord 2654f26
Update documentation
DanielNoord fcc8794
Remove docstring
DanielNoord 664eb18
Merge branch 'main' of https://github.com/DanielNoord/pydocstringform…
DanielNoord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,5 @@ | ||
| def is_rst_title(summary: str) -> bool: | ||
| """Check if the second line of a summary is one recurring character.""" | ||
| # If second line is one recurring character we're dealing with a rst title | ||
| last_line = summary.splitlines()[-1].lstrip() | ||
| return last_line.count(last_line[0]) == len(last_line) |
This file contains hidden or 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 hidden or 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 hidden or 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
20 changes: 12 additions & 8 deletions
20
tests/data/format/beginning_quote/multi_line_no_push/class_docstring.py.out
This file contains hidden or 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 |
|---|---|---|
| @@ -1,22 +1,26 @@ | ||
| class MyClass: | ||
| """ | ||
| A multi-line | ||
| docstring. | ||
| A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
| class InnerClass: | ||
| """ | ||
| A multi-line | ||
| docstring. | ||
| A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
|
|
||
| class MyClass: | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
| class InnerClass: | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ |
10 changes: 6 additions & 4 deletions
10
tests/data/format/beginning_quote/multi_line_no_push/function_docstrings.py.out
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| def func(): | ||
| """ | ||
| A multi-line | ||
| docstring. | ||
| A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
| def inner_func(): | ||
| """ | ||
| A multi-line | ||
| docstring. | ||
| A multi-line. | ||
|
|
||
| docstring | ||
| """ |
5 changes: 3 additions & 2 deletions
5
tests/data/format/beginning_quote/multi_line_no_push/variable_docstring.py.out
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| MYVAR = 1 | ||
| """ | ||
| A multi-line | ||
| docstring. | ||
| A multi-line. | ||
|
|
||
| docstring | ||
| """ |
20 changes: 12 additions & 8 deletions
20
tests/data/format/beginning_quote/multi_line_push/class_docstring.py.out
This file contains hidden or 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 |
|---|---|---|
| @@ -1,20 +1,24 @@ | ||
| class MyClass: | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
| class InnerClass: | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
|
|
||
| class MyClass: | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
| class InnerClass: | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ |
10 changes: 6 additions & 4 deletions
10
tests/data/format/beginning_quote/multi_line_push/function_docstrings.py.out
This file contains hidden or 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 |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| def func(): | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
| def inner_func(): | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ |
5 changes: 3 additions & 2 deletions
5
tests/data/format/beginning_quote/multi_line_push/variable_docstring.py.out
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| MYVAR = 1 | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| MYVAR = 1 | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ |
20 changes: 12 additions & 8 deletions
20
tests/data/format/capitalization_first_letter/class_docstring.py.out
This file contains hidden or 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 hidden or 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
10 changes: 6 additions & 4 deletions
10
tests/data/format/capitalization_first_letter/variable_docstring.py.out
This file contains hidden or 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 |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| MYVAR = 1 | ||
| """ | ||
| A multi-line | ||
| docstring. | ||
| A multi-line. | ||
|
|
||
| docstring | ||
| """ | ||
|
|
||
| MYVAR = 1 | ||
| """A multi-line | ||
| docstring. | ||
| """A multi-line. | ||
|
|
||
| docstring | ||
| """ |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -9,5 +9,4 @@ def function(): | |
| """This has peculiar line ending; | ||
|
|
||
| but it should not matter. | ||
|
|
||
| """ | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.