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 file post-processing to Kotlin generators #1400

Merged
merged 2 commits into from
Nov 8, 2018
Merged

Conversation

wing328
Copy link
Member

@wing328 wing328 commented Nov 8, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

  • Add file post-processing to Kotlin generators (e.g. export KOTLIN_POST_PROCESS_FILE="/usr/local/bin/ktlint -F" with --enable-post-process-file using CLI)

3ca2aa8#diff-ed802784b178ca4a654ed7828c5eb0b8 shows the auto-format code done by ktlint

cc @jimschubert (2017/09) @dr4ke616 (2018/08)

@guenhter
Copy link
Contributor

guenhter commented Nov 8, 2018

This is cool.
Should klint run then in the CI as well?

@wing328
Copy link
Member Author

wing328 commented Nov 8, 2018

@guenhter very good question. At the moment, we don't do that because not all contributors (new or existing) have ktlint or other formatting tools (same version and setting) setup so we won't do it in our CIs at the moment.

@guenhter
Copy link
Contributor

guenhter commented Nov 8, 2018

Ok, but this PR is then already great because we have the possibility to add klint.

@dr4ke616
Copy link
Contributor

dr4ke616 commented Nov 8, 2018

This is very useful indeed 👍

@wing328
Copy link
Member Author

wing328 commented Nov 8, 2018

Thanks for reviewing. Merged it to master.

There's a minor issue with 2 files in the Kotlin cllient due to wildcard import: #1401

If anyone has time, please help fix it with a PR. Thanks.

@wing328 wing328 merged commit 3969afb into master Nov 8, 2018
@wing328 wing328 deleted the kotlin_post_process branch November 8, 2018 09:40
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* add post processing to kotlin file

* restore kotlin samples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants