Skip to content

Conversation

@nickcmaynard
Copy link
Contributor

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch 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)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

More work towards our code style standards aim #3972.

Uses Eclipse formatting tools with a configuration matching Google's style guide (plus our customisations).

This brings in an appropriately configured Java formatter maven plugin, but doesn't run it as part of the build. To manually run it:
mvn formatter:format

Having done this once, we fix ~2200 code style warnings.

~/Documents/Personal/swagger-codegen$ mvn clean compile | wc -l
    3809
➜  ~/Documents/Personal/swagger-codegen$ mvn formatter:format | wc -l
      80
➜  ~/Documents/Personal/swagger-codegen$ mvn clean compile | wc -l
    1660

I haven't included the results of a run in this PR, as it would generate lots of merge conflicts... I'd suggest whoever merges this PR does a once-off formatter run.

Uses Eclipse formatting tools with a configuration matching Google's style guide (plus our customisations).
@nickcmaynard nickcmaynard force-pushed the formatter-maven-plugin branch from 04efe5b to 9b63dcb Compare November 18, 2016 16:13
@wing328 wing328 merged commit 4c05d5f into swagger-api:master Nov 23, 2016
@wing328
Copy link
Contributor

wing328 commented Nov 23, 2016

@nickcmaynard thanks for the PR. I'll run mvn formatter:format later as there're some PRs about refactoring DefaultCodegen.

@wing328 wing328 added this to the v2.2.2 milestone Nov 23, 2016
@nickcmaynard
Copy link
Contributor Author

@wing328 Do you think the codebase is ready for a formatter run yet?

@nickcmaynard nickcmaynard deleted the formatter-maven-plugin branch November 30, 2016 13:52
@wing328
Copy link
Contributor

wing328 commented Nov 30, 2016

@nickcmaynard I'll do it after merging latest enhancements in the master to 2.3.0 first (there are lots of conflicts I need to resolve after removing the licenses from the templates)

@nickcmaynard
Copy link
Contributor Author

Fair - this will cause some conflicts. Just making sure it doesn't get buried under all the other stuff you're doing!

@wing328
Copy link
Contributor

wing328 commented Nov 30, 2016

Yup, I've created #4295 for tracking.

davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
Uses Eclipse formatting tools with a configuration matching Google's style guide (plus our customisations).
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.

2 participants