🛠️Linter
Also known as Lint, Static Checker
A tool that reads code without running it. It points out likely slips.
Think of it like
Think of it like a spell check for code. It marks what looks wrong before you send it.
Example
Ruff warns Jack that he set total but never used it. The real bug was that he returned price instead of total.
Why it matters
A linter catches small slips in seconds, before a test or a teammate has to. It keeps a shared codebase tidy.
Definition
Example code
console
$ ruff check pay.py
pay.py:1:8: F401 [*] `os` imported but unused
pay.py:4:5: F841 Local variable `total` is assigned to but never used
Found 2 errors.Common mistake
Key takeaways
- 1No running needed. It only reads the code.
- 2Finds likely bugs. Unused names and risky patterns stand out.
- 3Checks style too. One team, one way of writing.