diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9ed0a75 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +[*] +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[*.md] +trim_trailing_whitespace = false + +[{*.kt,*.kts}] +ij_kotlin_allow_trailing_comma = true +ij_kotlin_allow_trailing_comma_on_call_site = true +ij_kotlin_name_count_to_use_star_import = 2147483647 +ij_kotlin_name_count_to_use_star_import_for_members = 2147483647 +ij_kotlin_packages_to_use_import_on_demand = unset diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..f908f66 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,3 @@ +#!/bin/bash + +"$(git rev-parse --show-toplevel)"/gradlew ktlintCheck diff --git a/.github/workflows/sonarcloud-analyze.yml b/.github/workflows/sonarcloud-analyze.yml index 25522d9..03f8197 100644 --- a/.github/workflows/sonarcloud-analyze.yml +++ b/.github/workflows/sonarcloud-analyze.yml @@ -2,7 +2,7 @@ name: F-Lab SonarCloud Code Analyze on: pull_request: - types: [opened, synchronize, reopened] + types: [ opened, synchronize, reopened ] workflow_dispatch: env: @@ -22,7 +22,7 @@ jobs: REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2) ORG_NAME=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 1) SONAR_PROJECT_KEY="${ORG_NAME}_${REPO_NAME}" - echo "SONAR_PROJECT_KEY=$SONAR_PROJECT_KEY" >> $GITHUB_ENV + echo "SONAR_PROJECT_KEY=$SONAR_PROJECT_KEY" >> $GITHUB_ENV - name: Analyze with SonarCloud uses: SonarSource/sonarcloud-github-action@master @@ -35,5 +35,3 @@ jobs: args: -Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} -Dsonar.organization=f-lab-edu-1 - - \ No newline at end of file diff --git a/README.md b/README.md index a29a1aa..64a2d14 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ## About + 판매자와 소비자 간의 상품 거래를 중개하는 일반적인 커머스 플랫폼입니다. ## Stack @@ -9,3 +10,13 @@ - Gradle 8.14 - MySQL 8.0 - JPA (Hibernate 6.6) + +## Preferences + +### Git Hook + +Commit 시 자동으로 lint check 하기 위해 Git hook을 설정해야 합니다. 터미널에서 다음 명령어를 실행하세요: + +```bash +git config core.hooksPath .githooks +``` diff --git a/build.gradle.kts b/build.gradle.kts index 6d0c5fe..16bfa6e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,10 @@ plugins { kotlin("jvm") version "1.9.25" kotlin("plugin.spring") version "1.9.25" + kotlin("plugin.jpa") version "1.9.25" id("org.springframework.boot") version "3.5.0" id("io.spring.dependency-management") version "1.1.7" - kotlin("plugin.jpa") version "1.9.25" + id("org.jlleitschuh.gradle.ktlint") version "12.3.0" } group = "com.nilgil" diff --git a/src/test/kotlin/com/nilgil/commerce/GenericCommerceApplicationTests.kt b/src/test/kotlin/com/nilgil/commerce/GenericCommerceApplicationTests.kt index f18f576..6d01587 100644 --- a/src/test/kotlin/com/nilgil/commerce/GenericCommerceApplicationTests.kt +++ b/src/test/kotlin/com/nilgil/commerce/GenericCommerceApplicationTests.kt @@ -5,9 +5,7 @@ import org.springframework.boot.test.context.SpringBootTest @SpringBootTest class GenericCommerceApplicationTests { - @Test fun contextLoads() { } - }