linting

/ˈlɪntɪŋ/noun

Linting automatically checks source code for potential errors and violations of agreed coding rules, without running the application. The tool that performs these checks is called a linter.

Linting lets a developer see straight away that a variable is never used.

A linter reads the code and checks it against configured rules. It can flag an unused variable, unreachable code, or a pattern that is prone to errors. The warnings depend on the programming language, the tool, and the rules the team chooses. Linting is a form of Glossary · In briefstatic analysisStatic analysis examines source code or compiled code without running the program. It checks for potential errors, vulnerabilities, and violations of agreed coding rules.Read more.

When does a linter run?

A linter can run in the editor while a developer writes code. The same checks can also run automatically on each code change in a Glossary · In briefcontinuous integrationContinuous integration is a practice in which developers regularly merge small code changes and check them automatically, making integration problems visible early.Read more pipeline. This gives the whole team feedback based on the same conventions. The tool can fix some issues automatically; others need a developer to change the code.

What does a passing check tell you?

If the linter reports no issues, the checked code follows the configured rules. That does not prove the software does what the user expects. Tests check how the software behaves; in a Glossary · In briefcode reviewA code review is an assessment of a code change by another developer. They check its behaviour, readability, and maintainability, among other things, before the change is merged.Read more, a colleague also assesses the decisions behind it. Linting complements those checks.