Lint or linter is a static code analysis tool that was originally introduced in 1978. It is used to flag programming errors, stylistic errors or bugs.
Typically you will find developers using lint testing on their software code. But it is also something that is now being used by SysAdmins, DevOps engineers and the like.
Lint testing can be carried out on Infrastructure as Code (IaC) again to flag any errors, formatting discrepancies, or bugs or best practice violations.
Tania Allard explained that "adopting standards and letting linting take care of this also frees up loads of effort/time for reviewers (as in PRs) to focus on what really matters: implementation, new features, performance/security/experience improvements, edge and not so edge cases without losing focus due to ill-formatted code."
Why is Linting important?
Performing lint test, or linting your code is important to help reduce errors and ultimately improve the overall quality of your code.
Lint testing should be done early on in the development of your code, whether that is software code or Infrastructure as Code. It will help to spot any errors early and help your code writers focus on the right things.
Connell McGinley explained that lint testing is important because "Linters allow you to be more productive by catching errors early in the development process, instead of having to spend time debugging in production months down the line."
How to Lint test?
Depending on what you are creating and what your code is there are multiple ways of doing lint testing.
If you are creating your code within something like Visual Studio Code, you may find there is a plugin that can be used to help lint testing your code as you write it or to help test it at various different stages.
Another method is performing lint testing when code is checked into your source repository. When building out your DevOps Continuous Integration (CI)/Continuous Deployment (CD) pipeline, lint testing would be part of your CI process.
Top comments (0)