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

Add number of returns validator #3

Open
Melevir opened this issue May 4, 2020 · 1 comment
Open

Add number of returns validator #3

Melevir opened this issue May 4, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Melevir
Copy link
Contributor

Melevir commented May 4, 2020

If function has more that n returns in it's body, the plugin should raise error.
Max number of returns should be flake8 parameter.

@Melevir Melevir added the enhancement New feature or request label May 4, 2020
@tripcher
Copy link
Contributor

tripcher commented Apr 1, 2021

I'm ready to make the enhancement, but I have one question. Do I need to count returns in nested functions?
For example:

def decorator(func):
    def wrapper():
        print('example')
        return func()

    return wrapper

Does the decorator function have 1 return or 2?
For example the has_returns function in mr_proper counts returns in nested functions

@tripcher tripcher mentioned this issue Apr 8, 2021
korneevm pushed a commit that referenced this issue Apr 23, 2021
* Added function returns amount validation

* Fixed header in readme

Co-authored-by: Stanislav Shkitin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants