-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Standardise newlines after module-level docstrings #3932
Standardise newlines after module-level docstrings #3932
Conversation
Co-authored-by: jpy-git <[email protected]>
tests/data/module_docstring_1.py
Outdated
@@ -0,0 +1,25 @@ | |||
"""Single line module-level docstring should be followed by single newline.""" |
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.
I don't think we'll run this test as it's not in simple_cases/
.
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.
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.
|
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.
Thanks! Pushed a change moving the tests as I just changed the structure of the tests.
how can i exclude this from being enforced on my project? its caused 100s of files to need to change |
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
main
and 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.md
if necessary?