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 is a fast, cheap quality gate

Linting catches issues structural enough to be caught without running the code: unused imports, undefined variables, suspicious patterns, style violations, simple bug shapes (mutable default arguments, nested ternaries). It's the cheapest CI step and should run first.

Tools you'll use

  • Python: ruff (Astral) replaces flake8, isort, pylint-most, black formatting. 100× faster than the previous stack.
  • JavaScript / TypeScript: biome (the new Rust-based default) or eslint + prettier. Biome is faster and unified; eslint has the older plugin ecosystem.
  • Go: golangci-lint bundles dozens of linters.
  • Rust: clippy is built in.
  • YAML: yamllint, plus actionlint for GitHub Actions YAML specifically.
  • Shell scripts: shellcheck.

Pre-commit hooks let you run these locally before pushing. CI is the safety net, not the first line.

Code

Multi-tool 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

Add actionlint to your CI workflow. Run it on your existing workflow files. If it finds anything, fix it the same PR — those bugs will eventually fire.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.