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 postProcessFile, implement in Go generators to run gofmt #929

Merged
merged 4 commits into from
Sep 1, 2018

Conversation

wing328
Copy link
Member

@wing328 wing328 commented Aug 29, 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.3.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 postProcessFile to process each file generated by OpenAPI Generator
  • Implement postProcessFile in Go generators to run gofmt -w on each Go file
  • move ensure-up-to-date check to CircleCI

cc @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07)

cc @OpenAPITools/generator-core-team

@jimschubert
Copy link
Member

@wing328 This changes DefaultCodegen and CodegenConfig, and is a breaking change to that interface. Should this target 3.3.x branch instead of master?

@wing328
Copy link
Member Author

wing328 commented Aug 30, 2018

@jimschubert the change simply adds a new function and users won't be affected. (there's no change to the existing method signatures)

@wing328 wing328 modified the milestones: 3.2.3, 3.3.0 Aug 30, 2018
@wing328
Copy link
Member Author

wing328 commented Aug 30, 2018

@jimschubert Given that next release is 3.3.0, we can do that.

@jimschubert
Copy link
Member

@wing328 when you add a new method, doesn't that break users who have written custom generators? Or will the JVM automatically pick up the new changes in the interface and DefaultCodegen, allowing those custom generators to continue working?

@wing328
Copy link
Member Author

wing328 commented Aug 30, 2018

@jimschubert right, in the worst case, it will break the usage depending on how the user customizes the project.

Now it's targetting 3.3.0 (current master)

Conflicts:
	CI/circle_parallel.sh
	shippable.yml
Copy link
Member

@jmini jmini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not had the time to try it myself, but from a code review point of view, the change looks good.

@jmini
Copy link
Member

jmini commented Sep 1, 2018

Travis error is not related to this change, it was fixed with dd35acd

@wing328 wing328 merged commit e5244e8 into master Sep 1, 2018
@wing328 wing328 deleted the post_process_file branch September 1, 2018 13:02
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
…Tools#929)

* add postProcessFile, implement in Go generators to run gofmt

* minor fix to docstring

* update parallel job to 3
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