๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Programming/Phython

[42 Seoul] Norminette ์„ค์น˜ํ•˜๊ธฐ(ft. Homebrew)

728x90
๋ฐ˜์‘ํ˜•

Norminette๋Š” 42 ์•„์นด๋ฐ๋ฏธ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๋ฌธ๋ฒ• ๊ทœ์น™ ํ”„๋กœ๊ทธ๋žจ์ž…๋‹ˆ๋‹ค.

 

์ด ๊ธ€์€ ๊ฐœ์ธ ๋กœ์ปฌ ํ™˜๊ฒฝ์— norminette๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

 

mac os์ „์šฉ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ์ž์ธ homebrew๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ window ์‚ฌ์šฉ์ž๋Š” ์•„๋ž˜ ๊ณต์‹ ๊นƒํ—™์„ ํ™•์ธํ•˜์—ฌ ์„ค์น˜ํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

โฌ‡๏ธ 42 ๊ณต์‹ norminette github

https://github.com/42School/norminette

 

GitHub - 42School/norminette

Contribute to 42School/norminette development by creating an account on GitHub.

github.com

 

โฏ Norminette ์„ค์น˜ํ•˜๊ธฐ

1. homebrew ์„ค์น˜

ํ™ˆ๋ธŒ๋ฃจ๊ฐ€ ์„ค์น˜ ๋˜์–ด์žˆ์ง€ ์•Š๋‹ค๋ฉด, ์„ค์น˜ํ•ด์ฃผ์„ธ์š”.

๋‹ค์–‘ํ•œ ํŒจํ‚ค์ง€๋“ค์„ ์‰ฝ๊ฒŒ ์„ค์น˜ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ํˆด๋กœ ์ž์ฃผ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

https://brew.sh/index_ko

 

Homebrew

The Missing Package Manager for macOS (or Linux).

brew.sh

์œ„ ์‚ฌ์ดํŠธ์— ๋“ค์–ด๊ฐ€ ์•„๋ž˜ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด ํ„ฐ๋ฏธ๋„์— ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋ณต์‚ฌ / ๋ถ™์—ฌ ๋„ฃ๊ธฐ๋กœ ์‹คํ–‰ํ•ด ์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

brew -v

homebrew๊ฐ€ ์ž˜ ์„ค์น˜๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด์„œ ํ„ฐ๋ฏธ๋„์— ์œ„์™€ ๊ฐ™์€ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.

์œ„ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด Homebrew [์„ค์น˜๋œ ๋ฒ„์ „] ์ด ๋‚˜์˜จ๋‹ค๋ฉด ์ œ๋Œ€๋กœ ์„ค์น˜๋œ ๊ฒ๋‹ˆ๋‹ค.

๋งŒ์•ฝ์—, ์ œ๋Œ€๋กœ ๋‚˜์˜ค์ง€ ์•Š๋Š”๋‹ค๋ฉด, ํ„ฐ๋ฏธ๋„์„ ์ข…๋ฃŒ ํ›„ ๋ช…๋ น์–ด๋ฅผ ๋‹ค์‹œ ์‹คํ•ด์ฃผ์„ธ์š”. ๊ทธ๋ž˜๋„ ๋‚˜ํƒ€๋‚˜์ง€ ์•Š๋Š”๋‹ค๋ฉด ์ œ๋Œ€๋กœ ์„ค์น˜๊ฐ€ ๋˜์ง€ ์•Š์€ ๊ฒƒ์ด๋‹ˆ ๋‹ค์‹œ ํ™ˆ๋ธŒ๋ฃจ ์„ค์น˜ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด์„œ ์„ค์น˜ ํ›„ ์˜ค๋ฅ˜๋‚˜ ๋‚˜์˜ค๋Š”์ง€ ํ™•์ธํ•ด์ฃผ์„ธ์š”.

 

 2. python3 ์„ค์น˜

norminette๋ฅผ ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•ด์„œ python3 ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

brew install python3

์œ„ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ด homebrew๋ฅผ ํ†ตํ•ด์„œ python3๋ฅผ ์„ค์น˜ํ•ด์ฃผ์„ธ์š”.

 

๋งŒ์•ฝ, ์ด๋ฏธ python3๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด, ๊ฒฝ๊ณ ๋ฌธ๊ณผ ํ•จ๊ป˜ "brew reinstall python3" ๋ผ๋Š” ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ผ๋Š” ํ‘œ์‹œ๊ฐ€ ๋‚˜์˜ฌ ๊ฒ๋‹ˆ๋‹ค.(์•ฝ๊ฐ„ ๋‹ค๋ฅผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฒฝ๊ณ ๋ฌธ์„ ์ž˜ ์ฝ์–ด์ฃผ์„ธ์š”.) ๋ช…๋ น์–ด๋ฅผ ๊ทธ๋Œ€๋กœ ์ž…๋ ฅํ•ด์ค๋‹ˆ๋‹ค.

 

python3 ์„ค์น˜ ํ™•์ธํ•˜๊ธฐ

which python3

ํ„ฐ๋ฏธ๋„์„ ์ข…๋ฃŒ ํ›„ ๋‹ค์‹œ ์ผœ์ฃผ์„ธ์š”. ํ„ฐ๋ฏธ๋„์— ์œ„ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ด python3์ด ์„ค์น˜๋œ ์œ„์น˜๋ฅผ ํ™•์ธํ•ด์ฃผ์„ธ์š”.

์œ„ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด homebrew ๊ฒฝ๋กœ์— ๋“ค์–ด์žˆ๋‹ค๋ฉด, ์ œ๋Œ€๋กœ ์„ค์น˜๊ฐ€ ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

 3. norminette ์„ค์น˜

python3 -m pip install --upgrade pip setuptools
python3 -m pip install norminette

์œ„ ๋ช…๋ น์–ด๋ฅผ ์ฐจ๋ก€๋Œ€๋กœ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.

ํŒŒ์ด์ฌ ํŒจํ‚ค์ง€ ์„ค์น˜ ๋„๊ตฌ ์ตœ์‹ ํ™”, norimette ์„ค์น˜

 

์ด์ œ ํด๋Ÿฌ์Šคํ„ฐ์™€ ๊ฐ™์ด norminette๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

4. ํ™•์ธ ์‚ฌํ•ญ

ํ„ฐ๋ฏธ๋„์„ ๋‹ค์‹œ ์‹œ์ž‘ํ•œ ํ›„ ํ…Œ์ŠคํŠธ์šฉ ํŒŒ์ผ๋กœ norminette๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

 

์˜ˆ์‹œ:

norminette ft_print.c

norminette ์„ค์น˜ ์ค‘ ๋ฌธ์ œ๊ฐ€ ์—†์—ˆ์Œ์—๋„ ์ œ๋Œ€๋กœ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ค์ง€ ์•Š๋Š”๋‹ค๋ฉด, ์•„๋ž˜ ๋‘ ๊ฐ€์ง€ ์‚ฌํ•ญ์„ ํ™•์ธํ•ด์ฃผ์„ธ์š”.

 

1. ํ™•์ธํ•  ํŒŒ์ผ ๊ฒฝ๋กœ์— ์ œ๋Œ€๋กœ ์žˆ๋Š”์ง€ 

(ft_print.c ํŒŒ์ผ์„ norm ํ•˜๋ ค๋ฉด ํ•ด๋‹น ํŒŒ์ผ ์œ„์น˜์—์„œ norminette ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.)

 

2. alias ํ™•์ธ

vi ~/.zshrc

๋ช…๋ น์–ด๋กœ norminette ๊ฐ€ alias ๋˜์–ด์žˆ๋Š”์ง€ ํ™•์ธํ•ด์ฃผ์„ธ์š”.

alias๊ฐ€ ๋˜์–ด์žˆ๋Š” ์˜ˆ์‹œ

์ด์ „์— norminette๋ฅผ ์„ค์น˜ํ•˜๋‹ค๊ฐ€ alias (๋‹จ์ถ•๋ช…)์„ ์„ค์ •ํ•ด ๋†จ์„ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

๋งŒ์•ฝ, alias ๋˜์–ด์žˆ๋Š” ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋ฉด ์‚ญ์ œํ•ด์ฃผ์„ธ์š”.

 

์ด์ƒ์œผ๋กœ ๊ฐœ์ธ ๋””๋ฐ”์ด์Šค์— 42 ๊ณผ์ •์„ ์œ„ํ•œ norminette ์„ค์น˜ ๋ฐฉ๋ฒ•์ด์—ˆ์Šต๋‹ˆ๋‹ค.

 

์„ค์น˜ ๊ณผ์ • ์ค‘ ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค๋ฉด, ๋Œ“๊ธ€ ๋‚จ๊ฒจ์ฃผ์‹œ๋ฉด ๊ฐ™์ด ์ฐพ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

728x90
๋ฐ˜์‘ํ˜•