Skip to content

Commit d836aa8

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent ca242bd commit d836aa8

File tree

3 files changed

+44
-48
lines changed

3 files changed

+44
-48
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ToLower.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ public class ToLower extends ChangeCase {
2828
@FunctionInfo(
2929
returnType = { "keyword" },
3030
description = "Returns a new string representing the input string converted to lower case.",
31-
examples = { @Example(file = "string", tag = "to_lower"), @Example(file = "string", tag = "to_lower_mv", applies_to = "stack: ga 9.1") }
31+
examples = {
32+
@Example(file = "string", tag = "to_lower"),
33+
@Example(file = "string", tag = "to_lower_mv", applies_to = "stack: ga 9.1") }
3234
)
3335
public ToLower(Source source, @Param(name = "str", type = { "keyword", "text" }, description = """
3436
String expression. If `null`, the function returns `null`. The input can be:
3537
3638
- a single-valued column or expression
37-
39+
3840
- a multi-valued column or expression {applies_to}`stack: ga 9.1`""") Expression field, Configuration configuration) {
3941
super(source, field, configuration, Case.LOWER);
4042
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
import static org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry.mapParam;
7676
import static org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry.param;
7777
import static org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry.paramWithoutAnnotation;
78-
import static org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle.GA;
7978

8079
/**
8180
* This class exists to support the new Docs V3 system.
@@ -97,7 +96,6 @@ public abstract class DocsV3Support {
9796
protected static final String DOCS_WARNING =
9897
"% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.\n\n";
9998

100-
10199
static FunctionDocsSupport forFunctions(String name, Class<?> testClass) {
102100
return new FunctionDocsSupport(name, testClass);
103101
}
@@ -597,11 +595,11 @@ private String makeCallout(String type, String text) {
597595
}
598596

599597
private void appendLifeCycleAndVersion(StringBuilder appliesToText, FunctionAppliesTo appliesTo) {
600-
appliesToText.append(appliesTo.lifeCycle().name().toLowerCase(Locale.ROOT));
601-
if (appliesTo.version().isEmpty() == false) {
602-
appliesToText.append(" ").append(appliesTo.version());
603-
}
604-
}
598+
appliesToText.append(appliesTo.lifeCycle().name().toLowerCase(Locale.ROOT));
599+
if (appliesTo.version().isEmpty() == false) {
600+
appliesToText.append(" ").append(appliesTo.version());
601+
}
602+
}
605603

606604
private String makeAppliesToText(FunctionAppliesTo[] functionAppliesTos) {
607605
StringBuilder appliesToText = new StringBuilder();
@@ -638,40 +636,40 @@ private String makeAppliesToText(FunctionAppliesTo[] functionAppliesTos) {
638636
}
639637

640638
private void renderFullLayout(FunctionInfo info, boolean hasExamples, boolean hasAppendix, boolean hasFunctionOptions)
641-
throws IOException {
642-
String headingMarkdown = "#".repeat(2 + info.depthOffset());
643-
StringBuilder rendered = new StringBuilder(
644-
DOCS_WARNING + """
645-
$HEAD$ `$UPPER_NAME$` [esql-$NAME$]
646-
$APPLIES_TO$
647-
**Syntax**
648-
649-
:::{image} ../../../images/$CATEGORY$/$NAME$.svg
650-
:alt: Embedded
651-
:class: text-center
652-
:::
653-
654-
""".replace("$HEAD$", headingMarkdown)
655-
.replace("$NAME$", name)
656-
.replace("$CATEGORY$", category)
657-
.replace("$UPPER_NAME$", name.toUpperCase(Locale.ROOT))
658-
.replace("$APPLIES_TO$", makeAppliesToText(info.appliesTo()))
659-
);
660-
for (String section : new String[] { "parameters", "description", "types" }) {
661-
rendered.append(addInclude(section));
662-
}
663-
if (hasFunctionOptions) {
664-
rendered.append(addInclude("functionNamedParams"));
665-
}
666-
if (hasExamples) {
667-
rendered.append(addInclude("examples"));
668-
}
669-
if (hasAppendix) {
670-
rendered.append(addInclude("appendix"));
671-
}
672-
logger.info("Writing layout for [{}]:\n{}", name, rendered.toString());
673-
writeToTempSnippetsDir("layout", rendered.toString());
674-
}
639+
throws IOException {
640+
String headingMarkdown = "#".repeat(2 + info.depthOffset());
641+
StringBuilder rendered = new StringBuilder(
642+
DOCS_WARNING + """
643+
$HEAD$ `$UPPER_NAME$` [esql-$NAME$]
644+
$APPLIES_TO$
645+
**Syntax**
646+
647+
:::{image} ../../../images/$CATEGORY$/$NAME$.svg
648+
:alt: Embedded
649+
:class: text-center
650+
:::
651+
652+
""".replace("$HEAD$", headingMarkdown)
653+
.replace("$NAME$", name)
654+
.replace("$CATEGORY$", category)
655+
.replace("$UPPER_NAME$", name.toUpperCase(Locale.ROOT))
656+
.replace("$APPLIES_TO$", makeAppliesToText(info.appliesTo()))
657+
);
658+
for (String section : new String[] { "parameters", "description", "types" }) {
659+
rendered.append(addInclude(section));
660+
}
661+
if (hasFunctionOptions) {
662+
rendered.append(addInclude("functionNamedParams"));
663+
}
664+
if (hasExamples) {
665+
rendered.append(addInclude("examples"));
666+
}
667+
if (hasAppendix) {
668+
rendered.append(addInclude("appendix"));
669+
}
670+
logger.info("Writing layout for [{}]:\n{}", name, rendered.toString());
671+
writeToTempSnippetsDir("layout", rendered.toString());
672+
}
675673

676674
private String addInclude(String section) {
677675
return """

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3SupportTests.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,7 @@ public static class TestClass extends Function {
415415
file = "stats",
416416
tag = "count-or-null"
417417
) },
418-
appliesTo = {
419-
@FunctionAppliesTo(
420-
lifeCycle = FunctionAppliesToLifecycle.COMING,
421-
version = "9.1.0"
422-
) }
418+
appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.COMING, version = "9.1.0") }
423419
)
424420
public TestClass(Source source, @Param(name = "str", type = { "keyword", "text" }, description = """
425421
String expression. If `null`, the function returns `null`.

0 commit comments

Comments
 (0)