diff --git "a/.github/ISSUE_TEMPLATE/\352\270\260\353\212\245-\354\232\224\354\262\255-\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md" "b/.github/ISSUE_TEMPLATE/\352\270\260\353\212\245-\354\232\224\354\262\255-\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md" new file mode 100644 index 00000000..3b00327a --- /dev/null +++ "b/.github/ISSUE_TEMPLATE/\352\270\260\353\212\245-\354\232\224\354\262\255-\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md" @@ -0,0 +1,21 @@ +--- +name: 기능 요청 이슈 템플릿 +about: 기능 요청 이슈 템플릿입니다. +title: '' +labels: '' +assignees: '' + +--- + +Add a title +관련 이슈 제목 작성 ex. 인프라 초기 세팅 +--------------------------------------------------------------- +## Description +- 어떤 이슈인지 설명하는 란 입니다. +## To Do +- [ ] 프론트 CI 속도 개선 +- [ ] 백엔드 CD gradle 파일 캐시 개선 +- [ ] AI는 모델 경량화 개선 작업 + +## ETC +- 행복하다 diff --git "a/.github/ISSUE_TEMPLATE/\353\262\204\352\267\270-\353\246\254\355\217\254\355\212\270-\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md" "b/.github/ISSUE_TEMPLATE/\353\262\204\352\267\270-\353\246\254\355\217\254\355\212\270-\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md" new file mode 100644 index 00000000..81f1a989 --- /dev/null +++ "b/.github/ISSUE_TEMPLATE/\353\262\204\352\267\270-\353\246\254\355\217\254\355\212\270-\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md" @@ -0,0 +1,36 @@ +--- +name: 버그 리포트 이슈 템플릿 +about: 버그 리포트 이슈 템플릿입니다. +title: '' +labels: '' +assignees: '' + +--- + +## 🐛 버그 리포트 (Bug Report) + +### 📋 개요 (Summary) +발생한 버그에 대한 간략한 설명을 적어주세요. + +### 🔍 재현 절차 (Steps to Reproduce) +버그를 재현할 수 있는 방법을 단계별로 설명해주세요: +1. 첫 번째 단계 +2. 두 번째 단계 +3. ... + +### 🖥️ 예상 동작 (Expected Behavior) +정상적으로 동작했을 때 어떤 결과가 나와야 하나요? + +### ❌ 실제 동작 (Actual Behavior) +버그로 인해 실제로 발생한 결과를 적어주세요. + +### 🖼️ 스크린샷 (Screenshots) +문제를 보여줄 수 있는 스크린샷이 있으면 첨부해주세요. + +### 💻 환경 (Environment) +- OS: [e.g., Windows 10] +- 브라우저: [e.g., Chrome 91] +- 기타: [e.g., Node.js 14] + +### 🔗 관련된 이슈들 (Related Issues) +- 이 버그와 관련된 이슈 번호가 있다면 적어주세요. (예: `#123`) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..7acc4d32 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ +pr제목 -> 관련 이슈 #4 + +📌 관련 이슈 +--- + 프론트 CI 속도 개선 + +✨ PR 내용 +--- + 프론트 CI 속도 개선했음! diff --git a/build.gradle b/build.gradle index afb72f2a..1d4848cc 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '3.3.3' id 'io.spring.dependency-management' version '1.1.6' + id "com.diffplug.spotless" version '6.25.0' } group = 'com.ordertogether' @@ -17,22 +18,49 @@ repositories { mavenCentral() } +apply { + from('./tasks/update-git-hooks.gradle') +} + dependencies { + /** spring boot starter */ implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - //implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' - //implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6' - compileOnly 'org.projectlombok:lombok:1.18.34' - annotationProcessor('org.projectlombok:lombok') + + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.springframework.security:spring-security-test' + + /** thymeleaf and spring security integration */ + implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6' + + /** lombok */ + compileOnly 'org.projectlombok:lombok' + annotationProcessor 'org.projectlombok:lombok' + testCompileOnly 'org.projectlombok:lombok' + testAnnotationProcessor 'org.projectlombok:lombok' + developmentOnly 'org.springframework.boot:spring-boot-devtools' + runtimeOnly 'com.h2database:h2' runtimeOnly 'com.mysql:mysql-connector-j' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - //testImplementation 'org.springframework.security:spring-security-test' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } +spotless { + java { + importOrder() + indentWithTabs(2) + indentWithSpaces(4) + removeUnusedImports() + googleJavaFormat() + trimTrailingWhitespace() + endWithNewline() + } +} + tasks.named('test') { useJUnitPlatform() } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/scripts/pre-commit b/scripts/pre-commit new file mode 100644 index 00000000..706c7654 --- /dev/null +++ b/scripts/pre-commit @@ -0,0 +1,13 @@ +#!/bin/bash + +#1. 변경된 파일들 이름만 추출하여 저장 +stagedFiles=$(git diff --staged --name-only) +#2. SpotlessApply 실행 +echo "Running spotlessApply. Formatting code..." +./gradlew spotlessApply +#3. 변경사항이 발생한 파일들 다시 git add +for file in $stagedFiles; do + if test -f "$file"; then + git add "$file" + fi +done \ No newline at end of file diff --git a/src/main/java/com/ordertogether/team14_be/Team14BeApplication.java b/src/main/java/com/ordertogether/team14_be/Team14BeApplication.java index 587ab1cc..f7ee4ee4 100644 --- a/src/main/java/com/ordertogether/team14_be/Team14BeApplication.java +++ b/src/main/java/com/ordertogether/team14_be/Team14BeApplication.java @@ -6,8 +6,7 @@ @SpringBootApplication public class Team14BeApplication { - public static void main(String[] args) { - SpringApplication.run(Team14BeApplication.class, args); - } - + public static void main(String[] args) { + SpringApplication.run(Team14BeApplication.class, args); + } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index f5978374..00000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -spring.application.name=Team14_BE diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 00000000..8b0930e7 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + application: + name: Team14_BE diff --git a/src/test/java/com/ordertogether/team14_be/Team14BeApplicationTests.java b/src/test/java/com/ordertogether/team14_be/Team14BeApplicationTests.java index be28cd90..bc7fc754 100644 --- a/src/test/java/com/ordertogether/team14_be/Team14BeApplicationTests.java +++ b/src/test/java/com/ordertogether/team14_be/Team14BeApplicationTests.java @@ -6,8 +6,6 @@ @SpringBootTest class Team14BeApplicationTests { - @Test - void contextLoads() { - } - + @Test + void contextLoads() {} } diff --git a/tasks/update-git-hooks.gradle b/tasks/update-git-hooks.gradle new file mode 100644 index 00000000..f48f1c0c --- /dev/null +++ b/tasks/update-git-hooks.gradle @@ -0,0 +1,7 @@ +//pre-commit 스크립트 실행 권한 부여 +tasks.register('updateGitHooks', Copy) { + from './scripts/pre-commit' + into './.git/hooks' + fileMode 0775 +} +compileJava.dependsOn('updateGitHooks') \ No newline at end of file