Skip to content

java: run clang-format for Java files#56

Merged
rebello95 merged 2 commits intomasterfrom
java-format
Jun 10, 2019
Merged

java: run clang-format for Java files#56
rebello95 merged 2 commits intomasterfrom
java-format

Conversation

@rebello95
Copy link
Copy Markdown
Contributor

clang-format can be used for auto-formatting Java files the same way it is for Objective-C and C++.

2 spaces were selected for spacing to maintain parity with upstream.

Depends on:
envoyproxy/envoy#7210
envoyproxy/envoy#7211

#55

Signed-off-by: Michael Rebello mrebello@lyft.com

@rebello95
Copy link
Copy Markdown
Contributor Author

Will need to update envoy upstream SHA being checked in with this PR once the linked PRs land.

--add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./dist/Envoy.framework/ \
--skip_envoy_build_rule_check "$ENVOY_FORMAT_ACTION"
--skip_envoy_build_rule_check "$ENVOY_FORMAT_ACTION" \
--namespace_check_excluded_paths ./examples/ ./library/java/
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll remove the NOLINTs that are no longer necessary for Objective-C in another PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd suggest including that in this PR - then we can see that it's working via CI, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah nevermind, for some reason I was thinking this was the objective C PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea the diff as is will validate that this is working since prior to the upstream Envoy change, we were getting NOLINT violations for the .java files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#59

AccessModifierOffset: -2
ColumnLimit: 100
DerivePointerAlignment: false
IndentWidth: 2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

madness

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don’t have a preference as to what this value is, but all the other languages (and upstream) use 2 🤷🏽‍♂️

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is sparta

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Awesome. Your changes are merged upstream so just needs a submodule update.

@rebello95
Copy link
Copy Markdown
Contributor Author

Updated with upstream sha @mattklein123 @goaway

`clang-format` can be used for auto-formatting Java files the same way it is for Objective-C and C++.

2 spaces were selected for spacing to maintain parity with upstream.

Depends on:
envoyproxy/envoy#7210
envoyproxy/envoy#7211

Signed-off-by: Michael Rebello <mrebello@lyft.com>

update envoy sha

Signed-off-by: Michael Rebello <mrebello@lyft.com>

reformat after rebasing

Signed-off-by: Michael Rebello <mrebello@lyft.com>
Signed-off-by: Michael Rebello <mrebello@lyft.com>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Awesome!

@rebello95 friendly request to not force push if possible in the future. It makes reviews more difficult.

@rebello95
Copy link
Copy Markdown
Contributor Author

Sounds good, thanks @mattklein123.

@rebello95 rebello95 merged commit 99c206f into master Jun 10, 2019
@rebello95 rebello95 deleted the java-format branch June 10, 2019 16:53
rebello95 added a commit that referenced this pull request Jun 10, 2019
These are obsoleted by this change: #56 (comment)

Signed-off-by: Michael Rebello <mrebello@lyft.com>
rebello95 added a commit that referenced this pull request Jun 10, 2019
These are obsoleted by this change: #56 (comment)

Signed-off-by: Michael Rebello <mrebello@lyft.com>
rebello95 added a commit that referenced this pull request Jun 14, 2019
This was fixed as part of #56.

Signed-off-by: Michael Rebello <mrebello@lyft.com>
rebello95 added a commit that referenced this pull request Jun 14, 2019
This was fixed as part of #56.

Signed-off-by: Michael Rebello <mrebello@lyft.com>
@Augustyniak Augustyniak mentioned this pull request Nov 2, 2022
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 28, 2022
These are obsoleted by this change: envoyproxy/envoy-mobile#56 (comment)

Signed-off-by: Michael Rebello <mrebello@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 28, 2022
This was fixed as part of envoyproxy/envoy-mobile#56.

Signed-off-by: Michael Rebello <mrebello@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 29, 2022
These are obsoleted by this change: envoyproxy/envoy-mobile#56 (comment)

Signed-off-by: Michael Rebello <mrebello@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 29, 2022
This was fixed as part of envoyproxy/envoy-mobile#56.

Signed-off-by: Michael Rebello <mrebello@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
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.

5 participants