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

Use google-java-format in spotless #1934

Merged
merged 5 commits into from Jun 18, 2020
Merged

Commits on May 18, 2020

  1. Use google-java-format in spotless

    Google-java-format is an open source formatter [1]. It automatically formats
    source code based on the Google Java Style.
    
    The Mockito source code to a very large extent already adheres to this style
    guide. While this PR in itself is large, many of the changes are related to
    string formatting and nested method calls. Most notably, google-java-format
    is an improvement over the current formatting strategy in that:
    
    1. It handles comment formatting (e.g. spacing between comments)
    2. It handles nested method calls. You can see the difference in
    our usage of the ByteBuddy API, which is now more consistent
    3. It enforces the max-line length.
    
    It essentially automates all of the styling rules we list in
    https://github.com/mockito/mockito/blob/release/3.x/.github/CONTRIBUTING.md#alignment
    As such, for new contributors it should be a lot easier (and less scary)
    to contribute to Mockito, as they no longer have to be concerned about
    formatting. Hopefully, this once again lowers the bar for external contributors
    who want to help the project, but would otherwise feel overwhelmed by
    the rules we have to adhere to. (If we wouldn't have these rules, it would
    be a lot harder for us to maintain a consistent and maintainable codebase).
    
    The only interesting changes in this PR are those in `build.gradle`. All
    other changes were auto-generated by running `./gradlew spotlessApply`.
    
    Note that I disabled the formatting of Javadoc, as I think we should keep formatting
    that ourselves. We normally put a lot of time and effort in our Javadoc and changing
    that all at once seems like the wrong decision at this point in time.
    
    [1]: https://github.com/google/google-java-format
    TimvdLippe committed May 18, 2020
    Copy the full SHA
    8df197b View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2020

  1. Copy the full SHA
    90747ce View commit details
    Browse the repository at this point in the history
  2. Rerun formatter

    TimvdLippe committed Jun 18, 2020
    Copy the full SHA
    ae0046a View commit details
    Browse the repository at this point in the history
  3. Fix build

    TimvdLippe committed Jun 18, 2020
    Copy the full SHA
    8d5f28d View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    f0cee3a View commit details
    Browse the repository at this point in the history