Lint is a Unix utility that performs static program analysis on C language source code. The software gives its name to modern computing tools responsible for checking for coding style or formatting errors, known as a "linters" or "linting tools", even though the original Lint program performed static program analysis.

History

Stephen C. Johnson, a computer scientist at Bell Labs, came up with the term "lint" in 1978 while debugging the yacc grammar he was writing for C and dealing with portability issues stemming from porting Unix to a 32-bit machine.

Lint-like tools are especially useful for dynamically typed languages like JavaScript and Python. Because the interpreters of such languages typically do not enforce as many and as strict rules during execution, linter tools can also be used as simple debuggers for finding common errors (e.g. syntactic discrepancies) as well as hard-to-find errors such as heisenbugs (drawing attention to suspicious code as "possible errors"). Lint-like tools generally perform static analysis of source code.

Lint-like tools have also been developed for other aspects of software development, such as enforcing grammar and style guides for given language source code. Some tools (such as ESLint) also allow rules to be auto-fixable: a rule definition can also come with the definition of a transform that resolves the warning. Rules about style are especially likely to come with an auto-fix. If the linter is run in "fix all" mode on a file that triggers only rules about formatting, the linter will act just like a formatter.

See also

  • Splint (programming tool)
  • List of tools for static code analysis

References

Further reading