Linters in the Techlab

In our ongoing series about building a robust CI/CD pipeline, we’re focusing on the foundation: the development environment. Our “techlab,” as shown in the pipeline diagram, is where the magic happens. To ensure we’re building quality code from the start, we’re integrating linters into our workflow.

Graphical representation of the CI/CD Pipeline
CI/CD Pipeline

What are Linters?

Think of linters as automated code inspectors. They analyze your code for potential errors, style inconsistencies, and deviations from best practices. This helps us catch problems early on and maintain a high standard of code quality throughout the project.

Linters in Our Tech Lab

Our techlab is equipped with the following linters:

Installing Linters and VS Code Extensions

Here’s how to set up these linters, along with corresponding VS Code extensions for real-time feedback:

1. ansible-lint

2. yamllint

3. pylint

4. shellcheck

5. tflint

We are going to use the install script to get the default settings for tflint; however customizations are available. Refer to the GitHub page for details.

By incorporating these linters into our techlab development machine, we’re establishing a solid foundation for our CI/CD pipeline. But linters are only the first step! Next time, we’ll introduce code formatters that will automatically keep our code readable and consistent with best practices.

Leave a Reply

Your email address will not be published. Required fields are marked *