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

update spotless eclipse formatting rules #1582

Merged
merged 3 commits into from
Dec 14, 2020

Conversation

rzpt
Copy link
Contributor

@rzpt rzpt commented Dec 10, 2020

Before this PR

The eclipse rules did not match how spotless would format files for line wrapped asserts.

After this PR

==COMMIT_MSG==
Eclipse formatting rules now match the spotless format for line wrapped asserts.
==COMMIT_MSG==

Possible downsides?

None. There may be other rules that are out of sync that are not fixed by this update.

@changelog-app
Copy link

changelog-app bot commented Dec 10, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Eclipse formatting rules now match the spotless format for line wrapped asserts.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from ferozco December 10, 2020 22:58
Comment on lines +10 to +16
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="49"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

These are the new lines

@carterkozak
Copy link
Contributor

Eclipse formatting rules now match the spotless format for line wrapped asserts.

It's not clear why this differed given spotlessApply just runs the eclipse formatter directly. Perhaps slightly different versions with different default values for prefs that we didn't include in the configuration?

@carterkozak
Copy link
Contributor

@rzpt I wonder if the changelog issue has something to do with not having any email address configured for git? Probably worth a ticket against the robot if that fixes it!

commit 7293ce4819a7ad028758d90ba6ef2301a6ae3855
Author: rzpt <>
Date:   Thu Dec 10 14:53:25 2020 -0800

    update spotless eclipse formatting rules

Copy link
Contributor

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

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

lgtm

<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<profile kind="CodeFormatterProfile" name="PalantirStyle" version="20">
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a little odd, should the previous line also be updated to version="20"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you mean. Which previous line?

Copy link
Contributor

Choose a reason for hiding this comment

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

The outer xml element has version=18

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see. I can try exporting again to see what happens.

Copy link
Contributor Author

@rzpt rzpt left a comment

Choose a reason for hiding this comment

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

I assume that the defaults for spotless do not match the defaults for eclipse. I'm not sure why they'd do that...

<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<profile kind="CodeFormatterProfile" name="PalantirStyle" version="20">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you mean. Which previous line?

@carterkozak
Copy link
Contributor

Ack, if it works I'm not too worried either way, it just struck me as odd.
Feel free to merge when you're ready.

@bulldozer-bot bulldozer-bot bot merged commit b7b9722 into develop Dec 14, 2020
@bulldozer-bot bulldozer-bot bot deleted the update-spotless-eclipse-rules branch December 14, 2020 18:19
@svc-autorelease
Copy link
Collaborator

Released 3.59.1

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