C.W.K.
Stream
Lesson 08 of 13 · published

Linting

~10 min · lint, ruff, eslint

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Lint 는 빠르고 싼 품질 gate

Lint 는 코드 안 돌리고 잡을 수 있을 만큼 구조적인 이슈 잡아: 미사용 import, 미정의 변수, 의심스러운 패턴, style 위반, 단순 버그 모양 (mutable default 인자, 중첩 ternary). 가장 싼 CI step 이고 먼저 돌아야 해.

쓸 도구

  • Python: ruff (Astral) 가 flake8, isort, pylint 대부분, black formatting 대체. 이전 스택보다 100배 빠름.
  • JavaScript / TypeScript: biome (새 Rust 기반 default) 또는 eslint + prettier. Biome 이 더 빠르고 통합; eslint 는 더 오래된 plugin 생태계.
  • Go: golangci-lint 가 수십 linter 번들.
  • Rust: clippy 내장.
  • YAML: yamllint, GitHub Actions YAML 전용으로 actionlint.
  • Shell: shellcheck.

Pre-commit hook 으로 push 전 로컬 실행. CI 는 안전망, 첫 라인 아니야.

Code

Multi-도구 lint job·yaml
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v3
      - run: uv run ruff check .
      - run: uv run ruff format --check .
      - name: Lint workflow YAML
        uses: docker://rhysd/actionlint:latest
        with:
          args: -color
      - name: Lint shell scripts
        run: |
          sudo apt-get install -y shellcheck
          find scripts/ -name '*.sh' -exec shellcheck {} +

External links

Exercise

CI workflow 에 actionlint 추가. 기존 workflow 파일에서 돌려. 뭔가 찾으면 같은 PR 에서 고쳐 — 그 버그는 결국 발화해.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.