Learning path

Full curriculum

Full curriculum

Unit content

Static analysis, formatting and linting

Some defects and inconsistencies can be detected without running the program.

Static analysis examines source code or an intermediate representation to find properties such as unreachable code, suspicious data flow, type errors, misuse of APIs or patterns associated with defects.

A linter applies narrower rules about correctness, maintainability or project conventions. A formatter goes further for layout: instead of reporting style differences, it rewrites code into one canonical representation.

These tools are most useful when their output is deterministic and shared by the whole project. A rule enforced only in one developer's editor does not protect the shared codebase.

Not every warning deserves to block integration. Checks should have a defined policy so developers know which findings are errors, which are advisory and how exceptional cases are documented.

Automated static checks shift cheap, repeatable review work to tools and leave human review more attention for behavior, design and assumptions that require judgment.