Files
devops-guide/docs/linting-formatting.md
Jev Kuznetsov 846eca59d2 add knowledge
2026-04-23 12:06:00 +02:00

1.2 KiB

Linting & Formatting

Catch bugs and style issues automatically — before review, before CI, ideally before saving.

Tools by Language

Language Recommended Alternatives
Python ruff flake8 + isort + black
JavaScript/TS biome eslint + prettier
Go gofmt, golangci-lint staticcheck
C++ clang-tidy, clang-format cppcheck

Python — ruff

Replaces flake8, isort, and black in one tool. Extremely fast.

ruff check .          # lint
ruff check --fix .    # lint + auto-fix
ruff format .         # format (replaces black)

Configure in pyproject.toml:

[tool.ruff]
line-length = 100
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "I", "UP"]

JavaScript — biome

Single tool for lint + format, no config needed to start.

biome check .         # lint + format check
biome check --write . # auto-fix

Go

gofmt is part of the toolchain — just run it.

gofmt -w .
golangci-lint run     # broader lint suite

Tips

  • Run on save in your editor (not just in CI)
  • Auto-fix on commit via a pre-commit hook or invoke lint --fix
  • Format is non-negotiable; lint violations should be treated as errors in CI