Skip to content

๐Ÿค– AN ๊ฐœ๋ฐœ ์ปจ๋ฒค์…˜

JUNWON LEE edited this page Aug 7, 2024 · 20 revisions

๐Ÿ”ˆ Coding Convention

kotlin Coding Convention ์„ ๋”ฐ๋ฅธ๋‹ค.

ํŒ€ ์ฝ”๋”ฉ ์ปจ๋ฒค์…˜ ๋…ธ์…˜๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”!


๐Ÿ“‚ Package

  1. ํŒจํ‚ค์ง€ ๋„ค์ž„์€ ๋ฐ˜๋“œ์‹œ ์†Œ๋ฌธ์ž๋กœ ์ž‘์„ฑํ•œ๋‹ค.

  2. ํŒจํ‚ค์ง€๋Š” ํฌ๊ฒŒ data, presentation, remote, local ๋กœ ๋ถ„๋ฆฌํ•œ๋‹ค.

  3. UiState, UiEvent ์™€ ๊ด€๋ จ๋œ ์ฝ”๋“œ๋Š” ํŒŒ์ผ ๋ถ„๋ฆฌํ•˜๋˜, ViewModel ๊ณผ ๋™์ผํ•œ ํŒจํ‚ค์ง€์— ๋„ฃ๋Š”๋‹ค.

  4. BindingAdapter

  • ๊ณตํ†ต์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒฝ์šฐ์—๋Š” Common
  • CustomView ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” ํ•ด๋‹น ํŒŒ์ผ ๋‚ด์˜ companion object์— ์œ„์น˜ํ•˜๋„๋ก ํ•œ๋‹ค.
  • ํŠน์ • ํ™”๋ฉด์—์„œ๋งŒ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” ํ•ด๋‹น ํ™”๋ฉด package ์•ˆ์—์„œ ๋งŒ๋“ค์–ด ์‚ฌ์šฉํ•œ๋‹ค.
์˜ˆ์‹œ ์ž๋ฃŒ

๐Ÿ“‚ Naming

Resource ํŒŒ์ผ ๋ฐ ID ๋„ค์ด๋ฐ์€ ๊ธฐ๋ณธ์ ์œผ๋กœ [where]_[what] ์„ ๋ช…์‹œํ•œ๋‹ค.

Event๋ฅผ ์ฒ˜๋ฆฌ ํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋Š” XXXHandler ๋กœ ํ†ต์ผํ•œ๋‹ค

Function

๋ฐ˜ํ™˜๊ฐ’์ด ์žˆ๋Š” ํ•จ์ˆ˜๋Š” ๋นŒ๋” ํŒจํ„ด ๋„ค์ด๋ฐ ํ˜•์‹์„ ๋”ฐ๋ฅธ๋‹ค.

fun pocketBall(): PocketBall { .. }

// ๋งŒ์•ฝ pocketBall ์„ ์–ด๋– ํ•œ ๊ฐ€๊ณต์„ ํ•ด์„œ ๋ฆฌํ„ด๋ฐ›์•„์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ
fun availablePocketBall(): PorkcetBall { .. }

Layer Model

// entity
data class PocketMonEntity

// dto
data class PocketMonResponse
data class PocketMonRequest

// data - model (postfix X)
data class PocketMon

// UiModel
data class PocketMonUiModel

๐Ÿ“‚ ๊ฐ Layer Model ์˜ ์˜์กด์„ฑ ๋ฐฉํ–ฅ

UiModel -> Data -> Dto์œผ๋กœ ๋‹จ๋ฐฉํ–ฅ์œผ๋กœ ํ•œ๋‹ค. ์ด๋Ÿฌํ•œ ์˜์กด์„ฑ ๋ฐฉํ–ฅ์€ ๊ตฌ๊ธ€ ๊ถŒ์žฅ ์•„ํ‚คํ…์ฒ˜์— ๊ฐ€๊น๋‹ค. (ํด๋ฆฐ ์•„ํ‚คํ…์ฒ˜๊ฐ€ ์•„๋‹˜)

// -------------------------------------
package ~~~.presentation.model

data class PokemonUiModel(
    ...
)

fun Pokemon.toUi(): Pokemon = ...

// -------------------------------------
package ~~~.data.model

data class Pokemon(
    ...
)

fun PokemonResponse.toData(): Pokemon = ...

// -------------------------------------
package ~~~.dto.respoonse

data class PokemonResponse(
    ...
)
// -------------------------------------


๐Ÿ”ˆ Github Convention

๐Ÿ“Œ Commit

feat : ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€ feat: ์–ด์ฉŒ๊ตฌ ์ €์ฉŒ๊ตฌ ํ•œ๋‹ค

ui : ui ๊ด€๋ จ ์ž‘์—…

fix : ์ž˜๋ชป๋œ ๋ถ€๋ถ„ ์ˆ˜์ •

chore : ๋ฒ„์ „ ์ฝ”๋“œ ์ˆ˜์ •, ํŒจํ‚ค์ง€ ๊ตฌ์กฐ ๋ณ€๊ฒฝ, ํŒŒ์ผ ์ด๋™, ๊ฐ€๋…์„ฑ์ด๋‚˜ ๋ณ€์ˆ˜๋ช…, reformat ๋“ฑ

refactor : ๋‚ด๋ถ€ ๋กœ์ง์€ ๋ณ€๊ฒฝ ํ•˜์ง€ ์•Š๊ณ  ๊ธฐ์กด์˜ ์ฝ”๋“œ๋ฅผ ๊ฐœ์„ ํ•˜๋Š” ๋ฆฌํŒฉํ† ๋ง ์‹œ

docs : README๋‚˜ WIKI ๋“ฑ์˜ ๋ฌธ์„œ ๊ฐœ์ •

build : gradle ๊ฐ™์€๊ฑฐ ๊ด€๋ จ๋œ๊ฑฐ ์ถ”๊ฐ€ํ•  ๋•Œ


๐Ÿ“Œ Issue

[vesion/type] ์ž‘์—… ๋‚ด์šฉ

ex)
[1.0.0/AN-UI] home XML ๊ตฌํ˜„ / ๊ทœ์น™ ๋ทฐ ๊ตฌํ˜„

ํ…œํ”Œ๋ฆฟ

  • Assignees : ์ž๊ธฐ ์ž์‹ 
  • Labels : ์ž‘์—… ์œ ํ˜• (e. an_feat)
  • Projects : ์ž‘์—… ๊ด€๋ จ ๋ณด๋“œ (e. 1์ฐจ ๋ฐฐํฌ)
  • MileStone : ์ž‘์—… ๊ด€๋ จ ๋งˆ์ผ์Šคํ†ค (e. ํฌ์ผ“๋กœ๊ทธ 1์ฐจ ๋ฐฐํฌ)

๐Ÿ“Œ PR

[vesion/type] ์ž‘์—… ๋‚ด์šฉ

ex)
[1.0.0/AN-UI] home XML ๊ตฌํ˜„ / ๊ทœ์น™ ๋ทฐ ๊ตฌํ˜„

ํ…œํ”Œ๋ฆฟ

  • Reviewers : ์•ˆ๋“œ๋กœ์ด๋“œ ํŒ€์› ๋ชจ๋‘ ์„ ํƒ
  • Labels : PR, ์ž‘์—… ํƒ€์ž…
  • Projects : ์ž‘์—… ๊ด€๋ จ ๋ณด๋“œ (e. 1์ฐจ ๋ฐฐํฌ)
  • MileStone : ์ž‘์—… ๊ด€๋ จ ๋งˆ์ผ์Šคํ†ค (e. ํฌ์ผ“๋กœ๊ทธ 1์ฐจ ๋ฐฐํฌ)
  • Development : ํ•ด๋‹น ์ด์Šˆ ์—ฐ๊ฒฐ โ† ๋จธ์ง€์‹œ ์ž๋™์œผ๋กœ ํ•ด๋‹น ์ด์Šˆ๊ฐ€ ๋‹ซํžˆ๊ฒŒ ํ•ด์คŒ
### ์ž‘์—… ๊ฐœ์š”

### ์ž‘์—… ์„ค๋ช…

- ์ƒ์„ธํžˆ
- ๋ณด๋Š” ์‚ฌ๋žŒ ์ดํ•ด ์‰ฝ๊ฒŒ

### ์ž‘์—… ์‚ฌ์ง„ (์„ ํƒ)

- ์žˆ์œผ๋ฉด ๋ณด๊ธฐ ํŽธํ• ๋“ฏ

### ๋‹ค์Œ ํƒœ์Šคํฌ

๐Ÿ“Œ Projects

To do

  • ์ด์Šˆ๋ฅผ ์ถ”๊ฐ€ํ•  ๋•Œ ํ”„๋กœ์ ํŠธ๋ฅผ ์„ ํƒํ•˜๊ณ  ์ƒ์„ฑํ•˜๋ฉด ์ž๋™์œผ๋กœ To-do ์•ˆ์— ๋“ค์–ด๊ฐ„๋‹ค

In Progress

  • PR์„ ๋งŒ๋“ค๋ฉด ์ž๋™์œผ๋กœ ์ถ”๊ฐ€๋œ๋‹ค

Done

  • ์ด์Šˆ, PR์ด ๋‹ซํžˆ๋ฉด ์ž๋™์œผ๋กœ ์ถ”๊ฐ€๋œ๋‹ค.
Clone this wiki locally