๋ค์ด๊ฐ๋ฉฐ
์คํ์์ค๋ฅผ ๋ณด๋ฉด์ ๋ง์ ๊ฐ๋ฐ์๋ค์ด ์ผ์ ํ Convention์ ์ด๋ป๊ฒ ์ ์งํ ์ ์๋ ๋ฐฉ๋ฒ์ ๋ํ ์ข์ ๊ฐ์ด๋๊ฐ ์์ด ๊ณต์ ํฉ๋๋ค.
EditorConfig๋?
- ๋ง์ ๊ฐ๋ฐ์๋ค์ด ๋ค์ํ Editor๋ IDE์ ๊ด๊ณ์์ด ์ผ์ ํ ์ฝ๋ ์คํ์ผ์ ์ ์งํ๊ธฐ ์ํด ๋์์ฃผ๋ ์ค์ ํ์ผ์ ๋๋ค.
- ํ์ผ ํํ๋ก ์ ์ง๋๋ฉฐ ์ฝ๊ธฐ ์ฝ๊ณ ์คํ์ผ์ ๋ํ ํ์๊ด๋ฆฌ๊ฐ ๊ฐ๋ฅํ ์ฅ์ ์ด ์์ต๋๋ค.
Example
.editorconfig
๋ผ๋ ํ์ผ์ ์์ฑํ๊ณ ์ค์ ์ ์ถ๊ฐํ๋ฉด ๋ฉ๋๋ค.
Spring-boot editorconfig
root=true
[*.{groovy,java,kt,xml}]
indent_style = tab
indent_size = 4
continuation_indent_size = 8
Mockito editorconfig
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
์ง์๊ฐ๋ฅํ ์ค์ ์์ฑ
๋ชจ๋ ์๋ํฐ์์ ์ง์๊ฐ๋ฅํ ์์ฑ์ ์๋์ ์ ์ฃผ์ํด์ฃผ์ธ์ :)
- indent_style
- tab, space
- tab_width, indent_size
- number
- end_of_line
- lf, cr, crlf
- charset
- latin1, utf-8, utf-8-bom, utf-16be, utf-16le
- trim_trailing_whitespace
- ๊ณต๋ฐฑ ๋ฌธ์ ์ ๊ฑฐ
- insert_final_newline
- ํ์ผ ๋งจ๋ง์ง๋ง์ newline์ ์ถ๊ฐ ์ฌ๋ถ
- root