-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Formatting escape hatch #81806
Merged
pugnascotia
merged 4 commits into
elastic:master
from
pugnascotia:formatting-escape-hatch
Dec 16, 2021
Merged
Formatting escape hatch #81806
pugnascotia
merged 4 commits into
elastic:master
from
pugnascotia:formatting-escape-hatch
Dec 16, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pugnascotia
added
>bug
v8.0.0
:Delivery/Tooling
Developer tooliing and automation
v8.1.0
v7.16.2
labels
Dec 16, 2021
Pinging @elastic/es-delivery (Team:Delivery) |
Works on my machine 👍 Lgtm. Only question I have is wether
I guess currently the settings have no effect because the tags are disabled but it might cause some confusion. |
Good point, I've taken that config out. |
Luegg
approved these changes
Dec 16, 2021
pugnascotia
added
v7.17.0
auto-backport-and-merge
and removed
v7.16.2
auto-backport-and-merge
labels
Dec 16, 2021
pugnascotia
added a commit
that referenced
this pull request
Dec 16, 2021
Thanks to https://bugs.eclipse.org/bugs/show_bug.cgi?id=574437, we've run into a situation where Spotless is incorrectly formatting a particular piece of syntax (due the underlying Eclipse bug). We were able to turn off formatting of this syntax using `// @Formatter:off` and `// @Formatter:on`, but there was a further problem. We configure IntelliJ to use the Eclipse formatter plugin, but this doesn't respect the `@formatter` tags since these are set at the Spotless level, not the Eclipse formatter level. Note that these tags aren't set in the Eclipse formatter config, because there we use `// tag::` and `// end::` in order to avoid reformatting docs snippets, which have a much narrower line width. What a mess. So, to get around all this, drop the `@formatter` tags and tweak our custom `SnippetLengthCheck` Checkstyle rule so that `// tag:noformat` regions are not subject to the narrower line length check, but are still exempt from formatting.
pugnascotia
added a commit
that referenced
this pull request
Dec 16, 2021
Thanks to https://bugs.eclipse.org/bugs/show_bug.cgi?id=574437, we've run into a situation where Spotless is incorrectly formatting a particular piece of syntax (due the underlying Eclipse bug). We were able to turn off formatting of this syntax using `// @Formatter:off` and `// @Formatter:on`, but there was a further problem. We configure IntelliJ to use the Eclipse formatter plugin, but this doesn't respect the `@formatter` tags since these are set at the Spotless level, not the Eclipse formatter level. Note that these tags aren't set in the Eclipse formatter config, because there we use `// tag::` and `// end::` in order to avoid reformatting docs snippets, which have a much narrower line width. What a mess. So, to get around all this, drop the `@formatter` tags and tweak our custom `SnippetLengthCheck` Checkstyle rule so that `// tag:noformat` regions are not subject to the narrower line length check, but are still exempt from formatting.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Delivery/Tooling
Developer tooliing and automation
Team:Delivery
Meta label for Delivery team
v7.17.0
v8.0.0-rc1
v8.1.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks to https://bugs.eclipse.org/bugs/show_bug.cgi?id=574437, we've run into a situation where Spotless is incorrectly formatting a particular piece of syntax (due the underlying Eclipse bug). We were able to turn off formatting of this syntax using
// @formatter:off
and// @formatter:on
, but there was a further problem. We configure IntelliJ to use the Eclipse formatter plugin, but this doesn't respect the@formatter
tags since these are set at the Spotless level, not the Eclipse formatter level. Note that these tags aren't set in the Eclipse formatter config, because there we use// tag::
and// end::
in order to avoid reformatting docs snippets, which have a much narrower line width.What a mess.
So, to get around all this, drop the
@formatter
tags and tweak our customSnippetLengthCheck
Checkstyle rule so that// tag:noformat
regions are not subject to the narrower line length check, but are still exempt from formatting.