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

Format Only Changes #197

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Format Only Changes #197

wants to merge 6 commits into from

Conversation

SentryMan
Copy link
Collaborator

@SentryMan SentryMan commented Feb 17, 2025

  • sorts Context/Jex members
  • adds auto-formatter
  • format code with the google java style palantir-style

@SentryMan SentryMan changed the title Format Changes Format Only Changes Feb 17, 2025
@SentryMan SentryMan enabled auto-merge (squash) February 17, 2025 18:40
@rbygrave
Copy link
Contributor

format code with the google java style

I'm unconvinced by this.

@SentryMan
Copy link
Collaborator Author

I'm unconvinced by this.

Is there any particular reason?

Pros:

  • It all but eliminates "diff noise" due to whitespace and other insignificant formatting choices, allowing contributors/reviewers to focus on logic and functionality.
  • Enforces code consistency no matter what tool you use to write code
  • By automating formatting, contributors are less likely to introduce manual formatting mistakes.

Cons:

  • Removes the ability to do any 'special-case' formatting where an alternate format would make code more readable in some cases.

@rbygrave
Copy link
Contributor

Is there any particular reason?

For me, it fails aesthetically in too many common cases with too much indentation (double and quadrupedal indentation) and line breaking.

There are formatters that don't aesthetically fail as much as google java style / basically closer to IntelliJ style.

@SentryMan
Copy link
Collaborator Author

do you have one in mind that I can setup automatic formatting with?

@SentryMan
Copy link
Collaborator Author

SentryMan commented Feb 17, 2025

For me I couldn't care less about any particular code style, it's just that a standard format that can be enforced automatically makes contribution/reviewing easier.

@SentryMan
Copy link
Collaborator Author

what do you think about https://github.com/palantir/palantir-java-format

@rbygrave
Copy link
Contributor

what do you think about https://github.com/palantir/palantir-java-format

I have been trying it out actually, but yes it does kinda suck in some DSL cases [e.g. ebean query bean queries] so I'm not 100% sold on it. Still looking.

@SentryMan
Copy link
Collaborator Author

it does kinda suck in some DSL cases [e.g. ebean query bean queries]

okay, but are those DSL cases in this repo/pr? I'm not talking about changing what you use for application development.

@SentryMan SentryMan force-pushed the format branch 6 times, most recently from 629092b to 1eed5f9 Compare February 25, 2025 04:29
@SentryMan SentryMan requested a review from rbygrave February 25, 2025 04:50
SentryMan and others added 4 commits March 1, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants