-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 코딩 컨벤션 설정을 위한 Spotless 세팅 (#14)
* chore: plain jar 생성되지 않도록 변경 * chore: spotless 추가 및 설정 * style: spotless 포맷팅 적용 * chore: 커밋 전 spotless 적용을 위한 pre-commit 작성 * docs: CODEOWNER 변경 * chore: palantir java format 사용하도록 변경 * style: spotless 적용
- Loading branch information
Showing
11 changed files
with
81 additions
and
42 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@GDSC-Hongik/backend-dev | ||
* @GDSC-Hongik/backend-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ assignees: '' | |
--- | ||
|
||
## 📌 Description | ||
- | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ assignees: '' | |
--- | ||
|
||
## 📌 Description | ||
- | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ assignees: '' | |
--- | ||
|
||
## 📌 Description | ||
- | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ assignees: '' | |
--- | ||
|
||
## 📌 Description | ||
- | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
- close # | ||
|
||
## 📌 작업 내용 및 특이사항 | ||
- | ||
- | ||
|
||
## 📝 참고사항 | ||
- | ||
- | ||
|
||
## 📚 기타 | ||
- | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,79 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.2.1' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
id 'org.asciidoctor.jvm.convert' version '3.3.2' | ||
id 'java' | ||
id 'org.springframework.boot' version '3.2.1' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
id 'org.asciidoctor.jvm.convert' version '3.3.2' | ||
id 'com.diffplug.spotless' version '6.23.3' | ||
} | ||
|
||
group = 'com.gdschongik' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
sourceCompatibility = '17' | ||
sourceCompatibility = '17' | ||
} | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
ext { | ||
set('snippetsDir', file("build/generated-snippets")) | ||
set('snippetsDir', file("build/generated-snippets")) | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.h2database:h2' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.h2database:h2' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
} | ||
|
||
tasks.named('test') { | ||
outputs.dir snippetsDir | ||
useJUnitPlatform() | ||
outputs.dir snippetsDir | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.named('asciidoctor') { | ||
inputs.dir snippetsDir | ||
dependsOn test | ||
inputs.dir snippetsDir | ||
dependsOn test | ||
} | ||
|
||
jar { | ||
enabled = false | ||
} | ||
|
||
spotless { | ||
format 'misc', { | ||
target '**/*.yml', '**/*.gradle', '**/*.md' | ||
trimTrailingWhitespace() | ||
indentWithSpaces(4) | ||
endWithNewline() | ||
} | ||
|
||
java { | ||
removeUnusedImports() | ||
palantirJavaFormat() | ||
formatAnnotations() | ||
} | ||
} | ||
|
||
tasks.register('updateGitHooks', Copy) { | ||
from './scripts/pre-commit' | ||
into '.git/hooks' | ||
|
||
compileJava.dependsOn(this) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 변경된 파일들 이름만 추출하여 저장 | ||
stagedFiles=$(git diff --staged --name-only) | ||
|
||
# SpotlessApply 실행 | ||
echo "Running spotlessApply. Formatting code..." | ||
./gradlew spotlessApply | ||
|
||
# 변경사항이 발생한 파일들 다시 git add | ||
for file in $stagedFiles; do | ||
if test -f "$file"; then | ||
git add "$file" | ||
fi | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ | |
@SpringBootTest | ||
class GdscApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
} | ||
|
||
@Test | ||
void contextLoads() {} | ||
} |