์ฐ๋ฆฌ๋ RuboCop์ ์ฌ์ฉํ์ฌ ์ ์ฒด ์ฝ๋๋ฒ ์ด์ค๋ฅผ ๋ฆฐํธํ๊ณ ์์ต๋๋ค.
์ด๊ฒ์ ์ฐ๋ฆฌ๊ฐ ์์ํ ๋ .rubocop_todo.yml
์ ์๋ ๋ชจ๋ ๊ท์น์ ๋ชฉ๋ก์
๋๋ค. ํ์ธ ํ์๋ "๊ณ ์ ๋์ด ๋ง์คํฐ์ ๋ณํฉ๋จ"์ ์๋ฏธํฉ๋๋ค.
์ด ์ค ํ๋๋ฅผ ์์ ํ๊ธฐ ์ํด PR์ ๋ง๋๋ ๊ฒฝ์ฐ RuboCop์ --only
์ต์
์ ์ฌ์ฉํ์ฌ ํ ๊ฐ์ง ์ ํ์ ์์ ์ ์ง์คํ์ญ์์ค. ์ด์ ๊ฐ์ ์ฝ๋๋ฅผ ๊ฒํ ํ ๋ ์๋๋๊ธฐ ์ฝ์ต๋๋ค. (๊ทธ๋ณด๋ค ์ฝ๊ฐ ๋ ์์ ํ๋ฉด ํฐ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ์ด๊ฒ์ ๋ณ๊ฒฝ ์ฌํญ์ ๊ฒํ ๊ฐ๋ฅํ ์ํ๋ก ์ ์งํ๋ ๊ฒ์
๋๋ค.)
# edit .rubocop.yml, commenting out the first line -
# this removes the "ignore the TODOs" setting
# Auto-correct with only 1 rule
rubocop -a --only Name/OfTheRuleYouAreFixing --auto-correct
# Re-generate the config file
rubocop --auto-gen-config
# Revert line 3 in .rubocop_todo.yml
# This will avoid PR conflicts
# Inspect to see if it looks OK
git diff
# Re-set the TODO list
git checkout .rubocop.yml
# Add and commit the change
git add .
git commit -m"chore: RuboCop lint Name/OfTheRuleYouAreFixing"
์ด ๋๊ธ์ ์ญ์ ํฉ๋๋ค. ๋์ ์ด์ ์ฃผ์ฅ์ ํ๋ ธ๋ค. ํฅํ ๊ฐ๋ฐ์๋ ์๋ฐ ์ฌํญ์ ํ์ธํ ๋ .rubocop_todo.yml ํ์ผ์ ์ ์ํด์ผ ํฉ๋๋ค.
ํ์ฌ ๋ง์คํฐ ์ฌํ์๋ CI๊ฐ ํฌ์ฐฉํ์ง ๋ชปํ๋ ์ผ๋ถ rubocop ์๋ฐ์ด ์์ต๋๋ค. ์ด๋ฌํ ๋ฌธ์ ๋ https://github.com/lostisland/faraday/pull/870 ๋ฐ https://github.com/lostisland/faraday/pull/871 ์์ ์์ ๋์์ต๋๋ค
๋ํ PR์ ์ด๋ฆ์ด [RuboCop] fix Layout/TrailingBlankLines
์ ๊ฐ์ ๊ฒฝ์ฐ ์์ ์ฒดํฌ๋ฆฌ์คํธ์ ์ถ๊ฐํ๊ธฐ๊ฐ ํจ์ฌ ์ฝ์ต๋๋ค.
Style/GlobalVars
์ฒดํฌ ํ์ํ ์ด์ ๋ script/generate_certs
๋ง ์๋ฐํ๊ธฐ ๋๋ฌธ์
๋๋ค. ์ด์ ํตํฉ ํ
์คํธ๊ฐ ์์ ํ ์ด์๋๋ฉด ํตํฉ ์ ํ๊ตฐ์ ๋ํ ์ด์ ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ ์ด ์๋ฐ ์ฌํญ์ ๋ง์ ์ฒ๋ผ ์์ ๋ฉ๋๋ค. ๋ค๋ฅธ ๊ณณ์ ์ถ๊ฐ๋ ๋ค๋ฅธ ์ ์ญ ๋ณ์๋ ๊ณ์ rubocop ์๋ฐ์ผ๋ก ํ์๋์ด์ผ ํฉ๋๋ค.
Style/Globalvars
:man_shrugging์ ์์ ํ๊ธฐ ์ ์ ์ด ๊ฒ์๋ฌผ์ ๋ณธ ์ ์ด ์์ต๋๋ค.
๊ฐ์ฌํฉ๋๋ค! ๐
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ฐ์ฌํฉ๋๋ค! ๐