Skip to content

[#2] 프로젝트 lint 설정 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

"$(git rev-parse --show-toplevel)"/gradlew ktlintCheck
6 changes: 2 additions & 4 deletions .github/workflows/sonarcloud-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: F-Lab SonarCloud Code Analyze

on:
pull_request:
types: [opened, synchronize, reopened]
types: [ opened, synchronize, reopened ]
workflow_dispatch:

env:
Expand All @@ -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
Expand All @@ -35,5 +35,3 @@ jobs:
args:
-Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }}
-Dsonar.organization=f-lab-edu-1


11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## About

판매자와 소비자 간의 상품 거래를 중개하는 일반적인 커머스 플랫폼입니다.

## Stack
Expand All @@ -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
```
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest
class GenericCommerceApplicationTests {

@Test
fun contextLoads() {
}

}
Loading