Skip to content
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

fix(checker): allow whitespace before inner functions and class #426

Merged
merged 3 commits into from Nov 30, 2019

Conversation

@johanfleury
Copy link
Contributor

johanfleury commented Oct 24, 2019

Changes D202: ("No blank lines allowed after function docstring") to
allow space below function docstrings with inner functions.

i.e. allows:

def outer():
    """Valid docstring."""

    def inner():
        pass

    return pass

See comment from @cdeil in #361.


This is a follow-up of PR #395.


  • Add unit tests and integration tests where applicable.
    If you've added an error code or changed an error code behavior,
    you should probably add or change a test case file under tests/test_cases/ and add
    it to the list under tests/test_definitions.py.
    If you've added or changed a command line option,
    you should probably add or change a test in tests/test_integration.py.
  • Add a line to the release notes (docs/release_notes.rst) under "Current Development Version".
    Make sure to include the PR number after you open and get one.
Changes D202: ("No blank lines allowed after function docstring") to
allow space below function docstrings with inner functions.

i.e. allows:

```python
def outer():
    """Valid docstring."""

    def inner():
        pass

    return pass
```

See comment from @cdeil in #361.
@johanfleury johanfleury force-pushed the johanfleury:feature/D202-inner-functions branch from f3a0754 to c42f43e Oct 24, 2019
@johanfleury johanfleury mentioned this pull request Oct 24, 2019
2 of 2 tasks complete
Copy link

Code0x58 left a comment

I just thought, there is the case of decorators around classes/functions, so that regex and test file could use @ cases.

For example it's fairly common to write a decorator that uses functions.wraps(...)

Avoid DeprecationWarning ("invalid escape sequence").
@johanfleury johanfleury force-pushed the johanfleury:feature/D202-inner-functions branch from c42f43e to aad7a24 Oct 25, 2019
@johanfleury

This comment has been minimized.

Copy link
Contributor Author

johanfleury commented Oct 25, 2019

I updated the PR and also added a commit to fix some DeprecationWarning.

Copy link

Code0x58 left a comment

Great!

@ColinKennedy

This comment has been minimized.

Copy link

ColinKennedy commented Nov 5, 2019

I just stumbled upon this PR. Is there anything that I can do to help it along or is it ready to merge?

@johanfleury

This comment has been minimized.

Copy link
Contributor Author

johanfleury commented Nov 7, 2019

@ColinKennedy we're just waiting for a review by a project member.

@Nurdok

This comment has been minimized.

Copy link
Member

Nurdok commented Nov 21, 2019

Sorry for the long delays in response - I've been on back-to-back family vacation and business trips. I'll to catch up as soon as I can.

src/pydocstyle/checker.py Show resolved Hide resolved
@johanfleury johanfleury force-pushed the johanfleury:feature/D202-inner-functions branch from aad7a24 to 3fe96ec Nov 27, 2019
@johanfleury johanfleury requested a review from Nurdok Nov 27, 2019
@Nurdok
Nurdok approved these changes Nov 30, 2019
@Nurdok Nurdok merged commit a1a4d0b into PyCQA:master Nov 30, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
daviddavis added a commit to daviddavis/pulp_ansible that referenced this pull request Dec 13, 2019
daviddavis added a commit to daviddavis/plugin_template that referenced this pull request Dec 13, 2019
daviddavis added a commit to daviddavis/pulp_ansible that referenced this pull request Dec 13, 2019
daviddavis added a commit to daviddavis/pulp_ansible that referenced this pull request Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.