File tree 7 files changed +46
-16
lines changed
main/java/org/vaadin/example
test/java/org/vaadin/example
7 files changed +46
-16
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "singleQuote" : true ,
3
+ "printWidth" : 120 ,
4
+ "bracketSameLine" : true
5
+ }
6
+
Original file line number Diff line number Diff line change @@ -76,6 +76,14 @@ Vaadin web applications are full-stack and include both client-side and server-s
76
76
|   ;  ;  ;  ; ` Application.java ` | Server entrypoint |
77
77
|   ;  ;  ;  ; ` AppShell.java ` | application-shell configuration |
78
78
79
+ ## Code Formatting
80
+
81
+ The project includes the Spotless code formatter.
82
+
83
+ To use it in IntelliJ, install the [ https://plugins.jetbrains.com/plugin/22455-spotless-applier ] (IntelliJ plugin)
84
+ To use it in VS Code, install the [ https://marketplace.visualstudio.com/items?itemName=richardwillis.vscode-spotless-gradle ] (VS Code extension)
85
+ To use it from the command line, run ` mvn spotless:apply `
86
+
79
87
## Useful links
80
88
81
89
- Read the documentation at [ vaadin.com/docs] ( https://vaadin.com/docs ) .
Original file line number Diff line number Diff line change 97
97
<groupId >org.springframework.boot</groupId >
98
98
<artifactId >spring-boot-maven-plugin</artifactId >
99
99
</plugin >
100
-
100
+ <plugin >
101
+ <groupId >com.diffplug.spotless</groupId >
102
+ <artifactId >spotless-maven-plugin</artifactId >
103
+ <version >2.43.0</version >
104
+ <configuration >
105
+ <java >
106
+ <palantirJavaFormat >
107
+ <version >2.50.0</version >
108
+ </palantirJavaFormat >
109
+ </java >
110
+ <!-- Uncomment to format TypeScript files
111
+ <typescript>
112
+ <includes>
113
+ <include>src/main/frontend/**/*.ts</include>
114
+ </includes>
115
+ <excludes>
116
+ <exclude>src/main/frontend/generated/**</exclude>
117
+ </excludes>
118
+ <prettier>
119
+ <prettierVersion>3.3.3</prettierVersion>
120
+ <configFile>.prettierrc.json</configFile>
121
+ </prettier>
122
+ </typescript>
123
+ -->
124
+ </configuration >
125
+ </plugin >
101
126
<plugin >
102
127
<groupId >com.vaadin</groupId >
103
128
<artifactId >vaadin-maven-plugin</artifactId >
Original file line number Diff line number Diff line change 3
3
import com .vaadin .flow .component .page .AppShellConfigurator ;
4
4
import com .vaadin .flow .server .PWA ;
5
5
import com .vaadin .flow .theme .Theme ;
6
-
7
6
import org .springframework .boot .SpringApplication ;
8
7
import org .springframework .boot .autoconfigure .SpringBootApplication ;
9
8
@@ -22,5 +21,4 @@ public class Application implements AppShellConfigurator {
22
21
public static void main (String [] args ) {
23
22
SpringApplication .run (Application .class , args );
24
23
}
25
-
26
24
}
Original file line number Diff line number Diff line change 1
1
package org .vaadin .example ;
2
2
3
3
import java .io .Serializable ;
4
-
5
4
import org .springframework .stereotype .Service ;
6
5
7
6
@ Service
@@ -14,5 +13,4 @@ public String greet(String name) {
14
13
return "Hello " + name ;
15
14
}
16
15
}
17
-
18
16
}
Original file line number Diff line number Diff line change 1
1
package org .vaadin .example ;
2
2
3
- import org .springframework .beans .factory .annotation .Autowired ;
4
-
5
3
import com .vaadin .flow .component .Key ;
6
4
import com .vaadin .flow .component .button .Button ;
7
5
import com .vaadin .flow .component .button .ButtonVariant ;
8
6
import com .vaadin .flow .component .html .Paragraph ;
9
- import com .vaadin .flow .component .notification .Notification ;
10
7
import com .vaadin .flow .component .orderedlayout .VerticalLayout ;
11
8
import com .vaadin .flow .component .textfield .TextField ;
12
9
import com .vaadin .flow .router .Route ;
10
+ import org .springframework .beans .factory .annotation .Autowired ;
13
11
14
12
/**
15
13
* A sample Vaadin view class.
@@ -32,8 +30,7 @@ public class MainView extends VerticalLayout {
32
30
* Build the initial UI state for the user accessing the application.
33
31
*
34
32
* @param service
35
- * The message service. Automatically injected Spring managed
36
- * bean.
33
+ * The message service. Automatically injected Spring managed bean.
37
34
*/
38
35
public MainView (@ Autowired GreetService service ) {
39
36
@@ -60,5 +57,4 @@ public MainView(@Autowired GreetService service) {
60
57
61
58
add (textField , button );
62
59
}
63
-
64
60
}
Original file line number Diff line number Diff line change 1
1
package org .vaadin .example ;
2
2
3
- import org .junit .jupiter .api .Assertions ;
4
- import org .junit .jupiter .api .BeforeEach ;
5
- import org .openqa .selenium .Keys ;
6
-
7
3
import com .vaadin .flow .component .button .testbench .ButtonElement ;
8
4
import com .vaadin .flow .component .html .testbench .ParagraphElement ;
9
5
import com .vaadin .flow .component .textfield .testbench .TextFieldElement ;
10
6
import com .vaadin .testbench .BrowserTest ;
11
7
import com .vaadin .testbench .BrowserTestBase ;
8
+ import org .junit .jupiter .api .Assertions ;
9
+ import org .junit .jupiter .api .BeforeEach ;
10
+ import org .openqa .selenium .Keys ;
12
11
13
12
public class MainViewIT extends BrowserTestBase {
14
13
@@ -27,7 +26,7 @@ private static String getDeploymentHostname() {
27
26
28
27
@ BeforeEach
29
28
public void open () {
30
- getDriver ().get ("http://" + getDeploymentHostname ()+ ":8080/" );
29
+ getDriver ().get ("http://" + getDeploymentHostname () + ":8080/" );
31
30
}
32
31
33
32
@ BrowserTest
You can’t perform that action at this time.
0 commit comments