Skip to content

Commit f2ad935

Browse files
authored
archetypes generating poorly formatted code (helidon-io#6623)
Signed-off-by: tvallin <thibault.vallin@oracle.com>
1 parent da713f0 commit f2ad935

19 files changed

Lines changed: 90 additions & 46 deletions

archetypes/helidon/src/main/archetype/common/docker.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2022 Oracle and/or its affiliates.
4+
Copyright (c) 2022, 2023 Oracle and/or its affiliates.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -76,7 +76,8 @@ docker build -t {{artifactId}} .
7676
7777
## Running the Docker Image
7878
79-
{{#docker-run-readme-section}}{{.}}
79+
{{#docker-run-readme-section}}
80+
{{.}}
8081
{{/docker-run-readme-section}}
8182
{{^docker-run-readme-section}}
8283
```
@@ -91,7 +92,8 @@ Exercise the application as described above.
9192
<![CDATA[
9293
## Building a Native Image
9394
94-
{{#native-sections}}{{.}}
95+
{{#native-sections}}
96+
{{.}}
9597
{{/native-sections}}
9698
]]>
9799
</value>

archetypes/helidon/src/main/archetype/common/files/README.md.mustache

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
## Build and run
66

7-
{{#readme-run-notes}}{{.}}
7+
{{#readme-run-notes}}
8+
{{.}}
89
{{/readme-run-notes}}
910

10-
{{#readme-run-commands}}{{.}}
11+
{{#readme-run-commands}}
12+
{{.}}
1113
{{/readme-run-commands}}
1214
{{^readme-run-commands}}
1315
With JDK17+
@@ -18,8 +20,10 @@ java -jar target/{{artifactId}}.jar
1820
{{/readme-run-commands}}
1921

2022
## Exercise the application
21-
{{#readme-exercise-the-application}}{{.}}
23+
{{#readme-exercise-the-application}}
24+
{{.}}
2225
{{/readme-exercise-the-application}}
2326

24-
{{#readme-sections}}{{.}}
27+
{{#readme-sections}}
28+
{{.}}
2529
{{/readme-sections}}

archetypes/helidon/src/main/archetype/common/files/pom.xml.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
</execution>
5151
</executions>
5252
</plugin>
53-
{{#maven-plugins}}{{.}}
53+
{{#maven-plugins}}
54+
{{.}}
5455
{{/maven-plugins}}
5556
</plugins>
5657
</build>

archetypes/helidon/src/main/archetype/common/observability.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2022 Oracle and/or its affiliates.
4+
Copyright (c) 2022, 2023 Oracle and/or its affiliates.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -431,7 +431,8 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
431431
<value template="mustache" order="0"><![CDATA[
432432
HealthSupport health = HealthSupport.builder()
433433
.addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks
434-
{{#Main-healthBuilder}}{{.}}
434+
{{#Main-healthBuilder}}
435+
{{.}}
435436
{{/Main-healthBuilder}}
436437
.build();]]>
437438
</value>

archetypes/helidon/src/main/archetype/common/packaging.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ kubectl get pods # Verify connectivity to cluster
5353
{{#k8s-readme-sections}}
5454
{{#first}}
5555
56-
{{/first}}{{.}}
56+
{{/first}}
57+
{{.}}
5758
{{/k8s-readme-sections}}
5859
5960
### Deploy the application to Kubernetes

archetypes/helidon/src/main/archetype/mp/common/files/src/main/resources/META-INF/microprofile-config.properties.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ server.host=0.0.0.0
55
# Change the following to true to enable the optional MicroProfile Metrics REST.request metrics
66
metrics.rest-request.enabled=false
77

8-
{{#microprofile-config-entries}}{{.}}
8+
{{#microprofile-config-entries}}
9+
{{.}}
910
{{/microprofile-config-entries}}
1011

1112
{{#database-hikari}}

archetypes/helidon/src/main/archetype/mp/common/files/src/main/resources/application.yaml.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
{{#security}}
55
security:
66
providers:
7-
{{#providers-config-entries}}{{.}}
7+
{{#providers-config-entries}}
8+
{{.}}
89
{{/providers-config-entries}}
910
web-server:
1011
# protected paths on the web server - do not include paths served by Jersey, as those are protected directly
1112
paths:
12-
{{#paths-config-entries}}{{.}}
13+
{{#paths-config-entries}}
14+
{{.}}
1315
{{/paths-config-entries}}
1416
{{/security}}

archetypes/helidon/src/main/archetype/mp/common/files/src/main/resources/logging.properties.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ handlers=io.helidon.common.HelidonConsoleHandler
77
{{#oci-logging-entries}}
88
{{#first}}
99

10-
{{/first}}{{.}}
10+
{{/first}}
11+
{{.}}
1112
{{/oci-logging-entries}}
1213

1314
# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread

archetypes/helidon/src/main/archetype/mp/common/files/src/test/java/__pkg__/MainTest.java.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ import {{.}};
2222
{{/helidon-test}}
2323
class MainTest {
2424
{{#helidon-test}}
25-
{{#MainTest-static-fields}}{{.}}
25+
{{#MainTest-static-fields}}
26+
{{.}}
2627
{{/MainTest-static-fields}}
2728

2829
@Inject
2930
private WebTarget target;
3031

31-
{{#MainTest-methods}}{{.}}
32+
{{#MainTest-methods}}
33+
{{.}}
3234
{{/MainTest-methods}}
3335
{{/helidon-test}}
3436
}

archetypes/helidon/src/main/archetype/mp/custom/files/src/main/java/__pkg__/SimpleGreetResource.java.json.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import org.eclipse.microprofile.config.inject.ConfigProperty;
2626
*/
2727
@Path("/simple-greet")
2828
public class SimpleGreetResource {
29-
{{#SimpleGreetResource-static-fields}}{{.}}
29+
{{#SimpleGreetResource-static-fields}}
30+
{{.}}
3031
{{/SimpleGreetResource-static-fields}}
3132
private final String message;
3233

@@ -49,7 +50,8 @@ public class SimpleGreetResource {
4950
return message;
5051
}
5152

52-
{{#SimpleGreetService-methods}}{{.}}
53+
{{#SimpleGreetService-methods}}
54+
{{.}}
5355
{{/SimpleGreetService-methods}}
5456

5557
}

0 commit comments

Comments
 (0)