Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Python] Remove redundant else statement #4311

Merged
merged 7 commits into from Oct 30, 2019
Merged

[Python] Remove redundant else statement #4311

merged 7 commits into from Oct 30, 2019

Conversation

ghost
Copy link

@ghost ghost commented Oct 29, 2019

If statement has a return statement inside it. There is no need for having else and introducing indentation in the code.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@ghost
Copy link
Author

ghost commented Oct 29, 2019

@taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01)

cc: @wing328

@ghost ghost changed the title [Python] Remove redundant else condition [Python] [Bug] Correct async return Oct 29, 2019
@ghost ghost changed the title [Python] [Bug] Correct async return [Python] Remove redundant else statement Oct 29, 2019
@wing328 wing328 merged commit eaca7b8 into OpenAPITools:master Oct 30, 2019
@wing328
Copy link
Member

wing328 commented Oct 30, 2019

@slash-arun the change looks good to me. I wonder if you can make the same enhancement to the python-experimental generator with a separate PR when you've time. Thanks.

@ghost
Copy link
Author

ghost commented Oct 30, 2019

@wing328 Sure, will push the changes for experimental generator by tonight

@ghost ghost deleted the py-remove-redundant-else branch October 30, 2019 10:04
@wing328
Copy link
Member

wing328 commented Oct 31, 2019

@slash-arun thanks for the PR, which has been included in v4.2.0 release: https://twitter.com/oas_generator/status/1189824932345069569

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant