| name | lint-formatting |
| description | Run language-specific linters, formatters, and static type checks with full command reference. Use when user asks to lint, format, type-check, check style, or says "๋ฆฐํธ", "ํฌ๋งท", "ํ์
์ฒดํฌ", "lint", "format", "type check", "biome", "ruff", "pyright", "clippy", "golangci-lint", "rumdl", "prettier", "shfmt". Also use when needing detailed command variants (check-only, fix-only, partial scope) beyond the standard fix-everything command. |
| allowed-tools | Bash, Read, Glob |
| model | sonnet |
| effort | low |
Lint & Formatting
์ธ์ด๋ณ lint/format/์ ์ ํ์
์ฒดํฌ ๋๊ตฌ์ ๋ช
๋ น์ด reference. ํ์ค "์์ + ํฌ๋งทํ
ํตํฉ" ๋ช
๋ น์ด์ check-only, ๋ถ๋ถ ์ ์ฉ ๋ฑ ๋ณํ์ ํจ๊ป ๋ค๋ฃฌ๋ค.
JavaScript/TypeScript (Biome)
- ๋ฆฐํธ๋ง:
biome lint .
- ํฌ๋งทํ
๋ง (์์ ):
biome format --write .
- ํฌ๋งทํ
๊ฒ์ฌ๋ง:
biome format .
- ๋ฆฐํธ + ํฌ๋งทํ
ํตํฉ ์์ :
biome check --write .
- ๊ฒ์ฌ๋ง (์์ ์์ด):
biome check .
Go (golangci-lint + gofmt)
golangci-lint๋ ๋ค์ํ ๋ฆฐํฐ๋ฅผ ํตํฉ ์คํํ๋ค.
- ๋ฆฐํธ ๊ฒ์ฌ:
golangci-lint run
- ํน์ ๋๋ ํฐ๋ฆฌ ๊ฒ์ฌ:
golangci-lint run ./...
- ์๋ ์์ :
golangci-lint run --fix
- ํฌ๋งทํ
:
gofmt -w .
Rust (clippy + rustfmt)
- ๋ฆฐํธ ๊ฒ์ฌ:
cargo clippy
- ๋ฆฐํธ ์๋ ์์ :
cargo clippy --fix
- ํฌ๋งทํ
:
cargo fmt
- ํฌ๋งทํ
๊ฒ์ฌ๋ง:
cargo fmt --check
Python (ruff)
- ๋ฆฐํธ ๊ฒ์ฌ:
ruff check .
- ๋ฆฐํธ ์๋ ์์ :
ruff check --fix .
- ํฌ๋งทํ
:
ruff format .
- ํฌ๋งทํ
๊ฒ์ฌ๋ง:
ruff format --check .
Python ์ ์ ํ์
์ฒดํฌ (pyright)
๋ถ๋ฅ์ lint/format ์ด ์๋ ์ ์ ํ์
์ฒดํฌ์ง๋ง, Python ์ฝ๋ ์์ ํ ๊ฒ์ฆ์๋ ruff ์ ํจ๊ป ํญ์ ํฌํจํ๋ค โ ์ฌ์ฉ์๊ฐ ์๋ํฐ์์ pyright diagnostics ๋ฅผ ๋ณด๊ณ ์์ด์, pyright ์๋ฌ๊ฐ ๋จ์ ์ปค๋ฐ์ ๋ฏธ์์ฑ ์ฝ๋๋ก ์ธ์๋๋ค.
- ๊ฒ์ฌ:
bunx pyright <์์ ํ ํ์ผ...> (pyright ๊ธ๋ก๋ฒ ๋ฏธ์ค์น โ bunx ๋ก ์คํ)
- ์์ ํ ํ์ผ๋ง ๊ฒ์ฌํ๋ค. repo ์ ์ฒด๋ฅผ 0 error ๊ฒ์ดํธ๋ก ๊ฑธ์ง ์๋๋ค โ pyright ๋ฏธ๋์
ํ๋ก์ ํธ๋ ๊ธฐ์กด ๋ถ์ฑ(ํนํ ๋์ ์คํ
ํจํด์ด ๋ง์ ํ
์คํธ ํ์ผ)๋ง์ผ๋ก ์๋ฌ๊ฐ ์์ญ~์๋ฐฑ ๊ฑด์ผ ์ ์๋ค.
- ๊ธฐ์กด ๋ถ์ฑ ์๋ฌ๋ ๋ฒ์ ์ธ โ ์์ /์ถ๊ฐํ ์ฝ๋์์ ๋์จ ์๋ฌ๋ง 0 ์ผ๋ก ๋ง๋ ๋ค. ๊ธฐ์กด ๋ถ์ฑ ์ผ๊ด ์ ๋ฆฌ๋ pyrightconfig ๋์
์ ์ฌ์ฉ์์ ๋ณ๋ ํฉ์ ํ ์งํํ๋ค.
- ์์ฃผ ๊ฑธ๋ฆฌ๋ ํจํด๊ณผ ํด๋ฒ:
- closure ๊ฐ ์บก์ฒํ ๋ณ์๋ ๋ฐ๊นฅ
if ์ narrowing ์ด ํจ์ ์์ผ๋ก ์ ํ๋์ง ์๋๋ค โ ํจ์ ๋ณธ๋ฌธ์์ ์ฌ๊ฒ์ฌ
.get() ๊ฒฐ๊ณผ๋ฅผ isinstance ๋ก ๊ฑฐ๋ฅธ ๋ค ["key"] ๋ก ์ฌ์ ๊ทผํ๋ฉด narrowing ์ด ์ ๋ถ๋๋ค โ walrus(:=) ๋๋ ๋ก์ปฌ ๋ณ์๋ก ๋ฐ์ธ๋ฉ
- try/except import fallback stub ์ ์คํจ์์ ํ๋ผ๋ฏธํฐ ์ด๋ฆ๊น์ง ์ผ์น์ํจ๋ค (์ด๋ฆ ๋ถ์ผ์น๋ ์๊ทธ๋์ฒ ๋นํธํ)
HTML (Prettier)
Biome๊ฐ HTML์ ๋ฏธ์ง์ํ๋ฏ๋ก Prettier๋ฅผ ์ฌ์ฉํ๋ค.
- ํฌ๋งทํ
:
bunx prettier --write <ํ์ผ>
- ๊ฒ์ฌ๋ง:
bunx prettier --check <ํ์ผ>
tidy๋ HTML ํฌ๋งทํฐ๋ก ์ฌ์ฉํ์ง ์๋๋ค. ์ฌ์ฉ์๊ฐ ๋ช
์์ ์ผ๋ก ์์ฒญํ๊ฑฐ๋
ํ๋ก์ ํธ ์คํฌ๋ฆฝํธ๊ฐ tidy๋ฅผ ์๊ตฌํ๋ ๊ฒฝ์ฐ์๋ง ์์ธ๋ก ๋ค๋ฃฌ๋ค.
Shell (shfmt)
- ํฌ๋งทํ
:
shfmt -i 4 -ci -w <file.sh>
- ๊ฒ์ฌ๋ง:
shfmt -d <file.sh>
Markdown (rumdl)
ํ์: rumdl ์ ์คํํ ๋๋ ํญ์ --extend-disable MD013 ํ๋๊ทธ๋ฅผ ๋ถ์ธ๋ค. ํ๋๊ทธ ์๋ rumdl check . / rumdl fmt . ํํ๋ ์ด ํ๊ฒฝ์์ ์ฌ์ฉํ์ง ์๋๋ค. MD013(line-length) ์ ํ๊ตญ์ด ๋ณธ๋ฌธ ๊ฐ๋
์ฑ ๋๋ฌธ์ ์๋์ ์ผ๋ก ๋ ์ ์ฑ
์ด๋ฉฐ, --extend-disable ์ ํ๋ก์ ํธ .rumdl.toml ์ disable ๋ชฉ๋ก์ ๋ํด์ง๋ ํํ๋ผ ๊ธฐ์กด ์ค์ ๊ณผ ์ถฉ๋ํ์ง ์๋๋ค.
- ๊ฒ์ฌ๋ง (์์ ์์ด):
rumdl check --extend-disable MD013 .
- ์๋ ์์ :
rumdl fmt --extend-disable MD013 .
- ์ถ๊ฐ ๊ท์น ๋๊ธฐ:
--extend-disable MD013,MD024 ์ฒ๋ผ ์ฝค๋ง๋ก ๋์ดํ๋ค (MD013 ์ ํญ์ ํฌํจ).
์คํ ์ ์ฐจ
- ์ฌ์ฉ์ ์์ฒญ์์ ๋์ ์ธ์ด์ ์์
(๊ฒ์ฌ vs ์์ )์ ํ์
ํ๋ค. ๋ช
์๋์ง ์์ผ๋ฉด
git status๋ก ๋ณ๊ฒฝ๋ ํ์ผ์ ํ์ฅ์๋ฅผ ํ์ธํ์ฌ ์ถ๋ก ํ๋ค.
- ์ reference์ ํ๋ก์ ํธ ์คํฌ๋ฆฝํธ(
package.json, Makefile, CI ์ค์ ๋ฑ)๋ฅผ ํ์ธํด ๋ช
๋ น์ด๋ฅผ ์ ํํ๋ค. reference์ ํ๋ก์ ํธ ์คํฌ๋ฆฝํธ๊ฐ ์ถฉ๋ํ๋ฉด ์ฌ์ฉ์์๊ฒ ํ์ธํ๋ค.
- ๋ช
๋ น์ด๋ฅผ ์ถ์ธกํ๊ฑฐ๋ ์ค์น๋ ๋๊ตฌ ์ด๋ฆ๋ง ๋ณด๊ณ ๋์ฒดํ์ง ์๋๋ค.
- ๊ฒฐ๊ณผ๋ฅผ ์ฌ์ฉ์์๊ฒ ๋ณด๊ณ ํ๋ค. ์๋ฌ๊ฐ ์์ผ๋ฉด ํ์ผ ๊ฒฝ๋ก์ ๋ผ์ธ ๋ฒํธ๋ฅผ ํจ๊ป ์ ์ํ๋ค.
์ฃผ์์ฌํญ
- ํ์ค "์์ ํ ์๋ ์์ " ์ํฌํ๋ก์ฐ๋
commit ์คํฌ์ด ์์ฒด์ ์ผ๋ก ์ฒ๋ฆฌํ๋ค. ์ด ์คํฌ์ ๋ช
์์ lint/format ์์ฒญ ๋๋ ๋ณํ ๋ช
๋ น์ด๊ฐ ํ์ํ ๋ ์ฌ์ฉํ๋ค.
- HTML๊ณผ Shell์
<ํ์ผ> ๋ถ๋ถ์ ์ค์ ํ์ผ ๊ฒฝ๋ก๋ก ์นํํ๋ค. ์ ์ฒด ๋๋ ํฐ๋ฆฌ ์ผ๊ด ์ ์ฉ ์์๋ fd์ ์กฐํฉํ๋ค (์: fd -e sh -x shfmt -i 4 -ci -w {}).