Standardise newlines after module-level docstrings#3932
Merged
JelleZijlstra merged 5 commits intopsf:mainfrom Oct 10, 2023
DanielNoord:module_docstring_newlines_rebase
Merged
Standardise newlines after module-level docstrings#3932JelleZijlstra merged 5 commits intopsf:mainfrom DanielNoord:module_docstring_newlines_rebase
JelleZijlstra merged 5 commits intopsf:mainfrom
DanielNoord:module_docstring_newlines_rebase
Conversation
Co-authored-by: jpy-git <josephyoung.jpy@gmail.com>
This was referenced Oct 8, 2023
| @@ -0,0 +1,25 @@ | |||
| """Single line module-level docstring should be followed by single newline.""" | |||
Collaborator
There was a problem hiding this comment.
I don't think we'll run this test as it's not in simple_cases/.
Contributor
Author
There was a problem hiding this comment.
Moved the tests to preview/ to make sure they run under preview mode. They executed now with pytest -k module_docstring.
Also added another two tests cases of which I thought the original PR didn't really have a good test:
- A file that already has a new line in-between the docstring and the rest of code and
- A file that has no lines in between the docstring and the rest of code and should thus get one
|
diff-shades results comparing this PR (03b7281) to main (5d5bf6e). The full diff is available in the logs under the "Generate HTML diff report" step. |
JelleZijlstra
approved these changes
Oct 10, 2023
Collaborator
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks! Pushed a change moving the tests as I just changed the structure of the tests.
28 tasks
11 tasks
|
how can i exclude this from being enforced on my project? its caused 100s of files to need to change |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Resolves #1872.
This is a rebase of #2996 and therefore most credit should go to @jpy-git.
I have excluded the refactoring that was included in the rebase attempt at #3287. I feel the refactoring makes the PR unnecessarily hard to review and rebase. It's probably a very desired refactor (I can't comment on this since I don't know the codebase too well), but it can be taken up in a specific PR.
I won't autoclose those PRs with this PR as I think the refactoring should probably be rebased on its own and not lost to the closed PR list.
I would appreciate a review as I'm not sure this is the right approach for the checks, it seemed to be the best compromise between
mainand the various versions of the check that @jpy-git wrote in their original PR. Happy to change it to another check if desired. I'd really like to see this change make it into the preview so happy to help wherever needed to get this to pass.Checklist - did you ...
CHANGES.mdif necessary?