Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Preventing the D103 error when the function is decorated with @overload. #511

Merged
merged 17 commits into from
Sep 13, 2020

Conversation

theyuvalraz
Copy link
Contributor

@theyuvalraz theyuvalraz commented Sep 5, 2020

Fixes #419

Added an is_overload method in the function class(parser.py).

Added an if statement so that the D103 error will not trigger when decorated with @overload(checker.py)

Added some tests to see that it's working correctly.

The lambda method in the checker returns None, not sure its a good practice. any suggestions ?

Added an is_overload method in the function class(parser.py).

Added an if statement so that the D103 error will not trigger when decorated with @overload(checker.py)

Added some tests to see that it's working correctly.
Added an is_overload method in the function class(parser.py).

Added an if statement so that the D103 error will not trigger when decorated with @overload(checker.py)

Added some tests to see that it's working correctly.
Added an if statement so that the D103 error will not trigger when decorated with @overload(checker.py)

Added some tests to see that it's working correctly.
@samj1912
Copy link
Member

samj1912 commented Sep 5, 2020

@theyuvalraz can you please rebase :)?

…error

# Conflicts:
#	src/pydocstyle/checker.py
@samj1912
Copy link
Member

samj1912 commented Sep 6, 2020

@theyuvalraz we also introduced isort and black formatting to the source code.

You will want to run black src/pydocstyle and isort src/pydocstyle from the project root

after installing the pinned versions from the requirements file.

Functions decorated with @overload
Functions decorated with @overload
Functions decorated with @overload
…rload

checker is also preventing the 102 error in methods that are decorated with @overload.

(checker.py) Any suggestions on how to write those if statements more elegantly? I really don't like the nested if statement.
src/tests/test_integration.py Show resolved Hide resolved
src/pydocstyle/checker.py Show resolved Hide resolved
src/tests/test_integration.py Show resolved Hide resolved
@samj1912
Copy link
Member

apart from the above lgtm

@samj1912
Copy link
Member

Thanks everything looks good! Can you also update the release notes with this change?

samj1912
samj1912 previously approved these changes Sep 13, 2020
docs/release_notes.rst Show resolved Hide resolved
docs/release_notes.rst Show resolved Hide resolved
@samj1912 samj1912 merged commit 7921a6d into PyCQA:master Sep 13, 2020
@samj1912
Copy link
Member

Thank you for this pull request!

@domdfcoding
Copy link

@samj1912 would it be possible to have a new release of pydocstyle with this feature?

@samj1912
Copy link
Member

Yeah, didn't notice this was not released. I will cut a release later today.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong “D103: Missing docstring in public function” for overload functions
3 participants