Skip to content

Commit

Permalink
chore: spotless 적용, properteis 파일 yml로 대체
Browse files Browse the repository at this point in the history
  • Loading branch information
rbm0524 committed Sep 20, 2024
2 parents 64db012 + 0fb2f33 commit 0ea24e4
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 15 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/기능-요청-이슈-템플릿.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: 기능 요청 이슈 템플릿
about: 기능 요청 이슈 템플릿입니다.
title: ''
labels: ''
assignees: ''

---

Add a title
관련 이슈 제목 작성 ex. 인프라 초기 세팅
---------------------------------------------------------------
## Description
- 어떤 이슈인지 설명하는 란 입니다.
## To Do
- [ ] 프론트 CI 속도 개선
- [ ] 백엔드 CD gradle 파일 캐시 개선
- [ ] AI는 모델 경량화 개선 작업

## ETC
- 행복하다
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/버그-리포트-이슈-템플릿.md
Original file line number Diff line number Diff line change
@@ -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`)
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pr제목 -> 관련 이슈 #4

📌 관련 이슈
---
프론트 CI 속도 개선

✨ PR 내용
---
프론트 CI 속도 개선했음!
40 changes: 34 additions & 6 deletions 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.3'
id 'io.spring.dependency-management' version '1.1.6'
id "com.diffplug.spotless" version '6.25.0'
}

group = 'com.ordertogether'
Expand All @@ -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()
}
Empty file modified gradlew
100644 → 100755
Empty file.
13 changes: 13 additions & 0 deletions scripts/pre-commit
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
1 change: 0 additions & 1 deletion src/main/resources/application.properties

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spring:
application:
name: Team14_BE
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
@SpringBootTest
class Team14BeApplicationTests {

@Test
void contextLoads() {
}

@Test
void contextLoads() {}
}
7 changes: 7 additions & 0 deletions tasks/update-git-hooks.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//pre-commit 스크립트 실행 권한 부여
tasks.register('updateGitHooks', Copy) {
from './scripts/pre-commit'
into './.git/hooks'
fileMode 0775
}
compileJava.dependsOn('updateGitHooks')

0 comments on commit 0ea24e4

Please sign in to comment.