Jump to content

Lint (software): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
History: Added fixed missing content
Tags: Reverted references removed Mobile edit Mobile web edit
Overview: Fixed added content
Tags: Reverted section blanking Mobile edit Mobile web edit
Line 6: Line 6:


==Overview==
==Overview==
The analysis performed by lint-like tools can also be performed by an [[optimizing compiler]], which aims to generate faster code. In his original 1978 paper, Johnson addressed this issue, concluding that "the general notion of having two programs is a good one" because they concentrated on different things, thereby allowing the programmer to "concentrate at one stage of the programming process solely on the [[algorithm]]s, [[data structure]]s, and correctness of the program, and then later retrofit, with the aid of lint, the desirable properties of universality and portability".<ref name="BellLabs"/>

Even though modern [[compiler]]s have evolved to include many of lint's historical functions, lint-like tools have also evolved to detect an even wider variety of suspicious constructs. These include "warnings about syntax errors, uses of [[Undefined variable|undeclared variables]], calls to deprecated functions, spacing and formatting conventions, misuse of scope, implicit fallthrough in [[Switch statement|switch statements]], missing license headers, [and]...dangerous language features".<ref name="phab">{{cite web|title=Arcanist User Guide: Lint|url=https://secure.phabricator.com/book/phabricator/article/arcanist_lint/|website=Phabricator|access-date=19 January 2018}}</ref>

Lint-like tools are especially useful for [[Type system#DYNAMIC|dynamically typed languages]] like [[JavaScript]] and [[Python (programming language)|Python]]. Because the compilers of such languages typically do not enforce as many and as strict rules prior to [[Execution (computing)|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 [[heisenbug]]s (drawing attention to suspicious code as "possible errors").<ref>{{Cite web|url=https://www.thecodecampus.de/blog/eslint-customizable-javascript-linting-tool-1/|title=ESLint - Customizable JavaScript linting tool (1)|date=2015-06-09|website=theCodeCampus|language=en-US|access-date=2019-04-21}}</ref> Lint-like tools generally perform [[static code analysis|static analysis]] of source code.<ref>{{cite news|url=https://barrgroup.com/Embedded-Systems/How-To/Lint-Static-Analysis-Tool|title=How to Use Lint for Static Code Analysis|date=1 May 2002|work=Barr Group|first=Nigel| last = Jones}}</ref>

Lint-like tools have also been developed for other aspects of language, including grammar and style guides.{{cn|date=July 2020}}


==Specialization==
==Specialization==

Revision as of 07:22, 11 January 2022

{{redirect-multi|3|Linting|Linter (software)|Lint tool|the MediaWiki extensio>

History

Stephen C. Johnson, a computer scientist at Bell Labs,>

Overview

Specialization

Fortran

Fortran compilers using space-squeezing techniques (e.g. IBM 1130)[1] made it impossible for the compiler to see the problem with lines like:

.... DO 120 J=1.256 ... 120 CONTINUE
which is why programs like Lint for Fortran[2] can be helpful.[3][4]

See also

References

  1. ^ Software: reads the source statements into memory, discards comment lines, removes spaces except in text literals, concatenates continuation lines
  2. ^ Lint for Fortran: Denis W. Haskin (May 2, 1988). "Shaking down your FORTRAN programs". Digital Review. pp. 41–47. similar to DEC's Source Code Analyzer, .. comes into play much earlier .. before users compile their programs
  3. ^ "COMP-FORTRAN-90 Archives". Fortran90-lint, for Fortran 90 program analysis, also other tools, from http://www.cleanscape.net/stdprod/ftp/ftpflint.html {{cite web}}: External link in |quote= (help)
  4. ^ "Chapter 2. Basic Debugger Usage". There is a public domain version of lint for FORTRAN 77 called ftnchek

Further reading