Skip to content

Commit 7deb58f

Browse files
committed
chore: fix lint errors
1 parent 4f8e8c9 commit 7deb58f

4 files changed

Lines changed: 67 additions & 13 deletions

File tree

‎checkstyle.xml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5+
<module name="Checker">
6+
<module name="TreeWalker">
7+
<module name="UnusedImports"/>
8+
<module name="RedundantImport"/>
9+
<module name="EqualsHashCode"/>
10+
</module>
11+
</module>

‎pom.xml‎

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,18 @@
179179
<endWithNewline />
180180
</java>
181181
</configuration>
182+
</plugin>
183+
<plugin>
184+
<groupId>org.apache.maven.plugins</groupId>
185+
<artifactId>maven-checkstyle-plugin</artifactId>
186+
<version>3.6.0</version>
187+
<configuration>
188+
<configLocation>checkstyle.xml</configLocation>
189+
<consoleOutput>true</consoleOutput>
190+
<failOnViolation>true</failOnViolation>
191+
</configuration>
182192
<executions>
183193
<execution>
184-
<id>spotless-check</id>
185194
<phase>verify</phase>
186195
<goals>
187196
<goal>check</goal>
@@ -191,4 +200,39 @@
191200
</plugin>
192201
</plugins>
193202
</build>
203+
204+
<profiles>
205+
<profile>
206+
<id>ci</id>
207+
<build>
208+
<plugins>
209+
<plugin>
210+
<groupId>com.diffplug.spotless</groupId>
211+
<artifactId>spotless-maven-plugin</artifactId>
212+
<executions>
213+
<execution>
214+
<id>spotless-check</id>
215+
<phase>verify</phase>
216+
<goals>
217+
<goal>check</goal>
218+
</goals>
219+
</execution>
220+
</executions>
221+
</plugin>
222+
<plugin>
223+
<groupId>org.apache.maven.plugins</groupId>
224+
<artifactId>maven-checkstyle-plugin</artifactId>
225+
<executions>
226+
<execution>
227+
<phase>verify</phase>
228+
<goals>
229+
<goal>check</goal>
230+
</goals>
231+
</execution>
232+
</executions>
233+
</plugin>
234+
</plugins>
235+
</build>
236+
</profile>
237+
</profiles>
194238
</project>

‎src/main/java/com/DesktopApplicationClientJava/Api/ApiClient.java‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public ApiClient(String baseUrl) {
3737
this.objectMapper = new ObjectMapper();
3838
this.objectMapper.registerModule(new JavaTimeModule());
3939

40-
this.httpController = new HttpController(baseUrl, httpClient, objectMapper, refreshToken, accessToken);
40+
this.httpController =
41+
new HttpController(baseUrl, httpClient, objectMapper, refreshToken, accessToken);
4142
this.authHandler = new AuthHandler(httpController);
4243
this.userHandler = new UserHandler(httpController);
4344
this.resourceHandler = new ResourceHandler(httpController);
@@ -47,11 +48,12 @@ public ApiClient(String baseUrl) {
4748

4849
// Получение информации пользователя о себе
4950
public UserDto getMe() throws IOException, InterruptedException {
50-
HttpRequest httpRequest = HttpRequest.newBuilder()
51-
.uri(URI.create(baseUrl + "/api/v1/user/me"))
52-
.header("Authorization", "Bearer " + accessToken)
53-
.GET()
54-
.build();
51+
HttpRequest httpRequest =
52+
HttpRequest.newBuilder()
53+
.uri(URI.create(baseUrl + "/api/v1/user/me"))
54+
.header("Authorization", "Bearer " + accessToken)
55+
.GET()
56+
.build();
5557

5658
HttpResponse<String> response = httpController.send(httpRequest);
5759
httpController.checkError(response);

‎src/main/java/com/DesktopApplicationClientJava/utils/ControllerWiring.java‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
import javafx.stage.Stage;
88

99
public final class ControllerWiring {
10-
private ControllerWiring() {
11-
}
10+
private ControllerWiring() {}
1211

1312
public static void wire(Object controller, Stage stage, Session session) {
14-
if (controller instanceof SessionAware sa)
15-
sa.setSession(session);
16-
if (controller instanceof NavigatorAware na)
17-
na.setNavigator(new Navigator(stage, session));
13+
if (controller instanceof SessionAware sa) sa.setSession(session);
14+
if (controller instanceof NavigatorAware na) na.setNavigator(new Navigator(stage, session));
1815
}
1916
}

0 commit comments

Comments
 (0)