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.
@sambhav
Copy link
Member

sambhav commented Sep 5, 2020

@theyuvalraz can you please rebase :)?

…error

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

sambhav 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
@theyuvalraz theyuvalraz requested a review from sambhav September 6, 2020 18:06
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.
@theyuvalraz theyuvalraz requested a review from sambhav September 12, 2020 03:15
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
@theyuvalraz theyuvalraz requested a review from sambhav September 13, 2020 19:18
@sambhav
Copy link
Member

sambhav commented Sep 13, 2020

apart from the above lgtm

@sambhav
Copy link
Member

sambhav commented Sep 13, 2020

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

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

sambhav commented Sep 13, 2020

Thank you for this pull request!

@domdfcoding
Copy link

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

@sambhav
Copy link
Member

sambhav commented Mar 18, 2021

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