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

Fix LineLength Check Suppressions: index.mapper #35087

Merged

Conversation

vladimirdolzhenko
Copy link
Contributor

Fix linelength suppressions in index.mapper

Relates #34884

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

LGTM

assertNotNull(update);
// original mapping not modified
assertEquals(mapping, serialize(mapper));
// but we have an update
assertEquals(Strings.toString(XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties")
.startObject("foo").startObject("properties").startObject("bar").startObject("properties").startObject("baz").field("type", "text")
.startObject("fields").startObject("keyword").field("type", "keyword").field("ignore_above", 256).endObject()
.startObject("foo").startObject("properties").startObject("bar").startObject("properties").startObject("baz")
Copy link
Member

Choose a reason for hiding this comment

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

I tend to try an indent these manually so they look a little more like json. Not that this is required, but it does help when they get big like this.

Copy link
Member

Choose a reason for hiding this comment

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

But this one is actually pretty huge. I don't think it'd fit!

.startObject()
.field("field", "value")
.startArray("nested1")
.startObject().field("field1", "1").startArray("nested2").startObject().field("field2", "2").endObject().startObject().field("field2", "3").endObject().endArray().endObject()
.startObject().field("field1", "4").startArray("nested2").startObject().field("field2", "5").endObject().startObject().field("field2", "6").endObject().endArray().endObject()
.startObject().field("field1", "1").startArray("nested2")
Copy link
Member

Choose a reason for hiding this comment

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

👍

.endObject()
.endObject());
String mapping = Strings.toString(XContentFactory.jsonBuilder()
.startObject()
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@vladimirdolzhenko vladimirdolzhenko merged commit be75b40 into elastic:master Oct 30, 2018
vladimirdolzhenko added a commit to vladimirdolzhenko/elasticsearch that referenced this pull request Oct 31, 2018
vladimirdolzhenko added a commit that referenced this pull request Oct 31, 2018
@vladimirdolzhenko vladimirdolzhenko deleted the linelength_cleanup_mapper branch October 31, 2018 12:45
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.

4 participants