Skip to content

Commit

Permalink
Merge pull request #11 from taco-official/KL-99/check-style-적용
Browse files Browse the repository at this point in the history
build(KL-99): check style 적용
  • Loading branch information
idealflower-k authored Jul 22, 2024
2 parents f945650 + 5ddd881 commit 83afae0
Show file tree
Hide file tree
Showing 9 changed files with 466 additions and 9 deletions.
13 changes: 12 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.3.1'
id 'io.spring.dependency-management' version '1.1.5'
id 'checkstyle'
}

group = 'taco'
Expand Down Expand Up @@ -38,6 +39,16 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('test') {
checkstyle {
maxWarnings = 0
toolVersion = '9.3'
configFile = file("${rootDir}/tool/naver-checkstyle-rules.xml")
configProperties = ["suppressionFile": "${rootDir}/tool/naver-checkstyle-suppressions.xml"]

}

test {
useJUnitPlatform()
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@Configuration
public class SwaggerConfig {
@Bean
public GroupedOpenApi KlklOpenApi() {
public GroupedOpenApi klklOpenApi() {
// "/v1/**" 경로에 매칭되는 API를 그룹화하여 문서화한다.
String[] paths = {"/v1/**"};

Expand All @@ -25,4 +25,4 @@ public GroupedOpenApi KlklOpenApi() {
.pathsToMatch(paths) // 그룹에 속하는 경로 패턴을 지정한다.
.build();
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/taco/klkl/global/error/ErrorResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ public record ErrorResponse(String code, String message) {
public static ErrorResponse of(String code, String message) {
return new ErrorResponse(code, message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public CustomException(ErrorCode errorCode) {
super(errorCode.getMessage());
this.errorCode = errorCode;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ public Object beforeBodyWrite(
}
return body;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void httpRequestMethodNotSupportedOccurred() {

@Test
@DisplayName("ExceptionInternal이 발생한 경우")
void ExceptionInternalOccurred() {
void exceptionInternalOccurred() {
// given
Exception exception = new RuntimeException("Test exception");
HttpHeaders headers = new HttpHeaders();
Expand Down Expand Up @@ -136,4 +136,4 @@ void handleException() {
assertEquals("C012", errorResponse.code());
assertEquals("서버에 문제가 발생했습니다. 관리자에게 문의해주세요.", errorResponse.message());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ void testBeforeBodyWrite_WithNullHttpStatus() {
// Then
assertEquals(body, result);
}
}
}
Loading

0 comments on commit 83afae0

Please sign in to comment.