ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๋ฐ˜์‘ํ˜•

โœ… [JAVA] ์ฝ”๋”ฉ ์ปจ๋ฒค์…˜

๋„ค์ด๋ฒ„ ์บ ํผ์Šค ํ•ต๋ฐ์ด ์ฝ”๋”ฉ์ปจ๋ฒค์…˜ ๋ฌธ์„œ ์ฐธ๊ณ 

IntelliJ ํŒŒ์ผ ๋์— ์ž๋™ ๊ฐœํ–‰

ํŒŒ์ผ ๋์— ๊ฐœํ–‰์„ ์ถ”๊ฐ€ํ•ด์•ผํ•˜๋Š” ์ด์œ 

https://blog.coderifleman.com/2015/04/04/text-files-end-with-a-newline/

 

ํŒŒ์ผ ๋์— ๊ฐœํ–‰์„ ์ถ”๊ฐ€ํ•ด์•ผ ํ•˜๋Š” ์ด์œ 

POSIX ๋ช…์„ธ๋ฅผ ๊ทผ๊ฑฐ๋กœ ํŒŒ์ผ ๋์— ๊ฐœํ–‰์„ ์ถ”๊ฐ€ํ•ด์•ผํ•˜๋Š” ์ด์œ ๋ฅผ ์•Œ์•„๋ณด๊ณ  WebStorm IDE์—์„œ ์ž๋™์œผ๋กœ ๊ฐœํ–‰์„ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค.

blog.coderifleman.com

IntelliJ Hard Wrap ์„ค์ •

Hard Wrap์€ ์ค„๋ฐ”๊ฟˆ ์œ„์น˜

command + ,(์„ค์ •) -> Code Style -> Hard Wrap at : 120 ์„ค์ •

์ด๋ ‡๊ฒŒ๋งŒ ์„ค์ •ํ•˜๋ฉด ์ž๋™์œผ๋กœ ์ค„๋ฐ”๊ฟˆ ์ฒ˜๋ฆฌ๊ฐ€ ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Code Style -> Java -> Wrapping and Braces -> Wrap on typing [Yes]  && Ensure right margin is not exceeded [Check] ๋ฅผ ํ•ด์ฃผ์–ด์•ผํ•ฉ๋‹ˆ๋‹ค.

IntelliJ ์ €์žฅ์‹œ ์ž๋™ ์ •๋ ฌ ๋ฐ import๋ฌธ ์ •๋ฆฌ

- IntelliJ ๋ฒ„์ „์ด 2021.2 ์ด์ƒ์ด์–ด์•ผ ํ•ด๋‹น ์˜ต์…˜์„ ์„ค์ •ํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ดํ•˜๋ฒ„์ „์—์„œ๋Š” plugin์—์„œ save action ์‚ฌ์šฉ

IntelliJ ๋ฒ„์ „ 2021.2 ๋ฒ„์ „ ์ด์ƒ์ธ ๊ฒฝ์šฐ์˜ ์…‹ํŒ…

IntelliJ checkstyle ์ ์šฉํ•˜๊ธฐ

https://github.com/checkstyle/checkstyle/releases/

 

Releases · checkstyle/checkstyle

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly co...

github.com

https://github.com/naver/hackday-conventions-java/tree/master/rule-config

 

GitHub - naver/hackday-conventions-java: ์บ ํผ์Šค ํ•ต๋ฐ์ด Java ์ฝ”๋”ฉ ์ปจ๋ฒค์…˜

์บ ํผ์Šค ํ•ต๋ฐ์ด Java ์ฝ”๋”ฉ ์ปจ๋ฒค์…˜. Contribute to naver/hackday-conventions-java development by creating an account on GitHub.

github.com

์œ„์˜ ๊นƒํ—™์— ๋“ค์–ด๊ฐ€์„œ rules, suppression, formatter ๋ฅผ ๋จผ์ € ๋‹ค์šด๋กœ๋“œ ํ•œ๋‹ค

IntelliJ -> plugins -> checkstyle ๋‹ค์šด๋กœ๋“œ

Tool -> checkstyle๊ฐ€์„œ ์•„๋ž˜์™€ ๊ฐ™์ด ์…‹ํŒ…ํ•ด์ค€๋‹ค

Configuration File ์•„๋ž˜ + ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ ์•„๋ž˜์™€ ๊ฐ™์ด ์…‹ํŒ…

Desc : naver-checkstyle-rules

browse -> ๋‹ค์šด๋ฐ›์•˜๋˜ naver-checkstyle-rules.xml ์„ ํƒ

Next ํด๋ฆญ

 

 

์ฐธ๊ณ  

- https://iamtaehoon.tistory.com/191

- https://creampuffy.tistory.com/128?category=986887 

 

๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
๋งํฌ
ยซ   2024/12   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
๊ธ€ ๋ณด๊ด€ํ•จ
๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (80)
๐Ÿ“บ Develop (0)
๐ŸŒ‹ Error Fixed (5)
๐Ÿ— Tool (5)
๐Ÿ’ป MacBook M1 (15)
๐Ÿ“ฆ ETC (1)

์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค.