BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News GitHub Super Linter Helps Developers Ensure No Broken Code Is Ever Merged

GitHub Super Linter Helps Developers Ensure No Broken Code Is Ever Merged

This item in japanese

GitHub Super Linter aims to automate the process of setting up your GitHub repositories so they will use the appropriate linter for your language whenever a pull request is created.

According to GitHub, its Super Linter will make it easier for developers to ensure broken code never makes it into their master branches. When using Super Linter:

[...] any time you open a pull request, it will start linting the code case and return via the Status API. It will let you know if any of your code changes passed successfully, or if any errors were detected, where they are, and what they are.

After fixing all detected issues, the developer can update the pull request and if Super Linter finds no additional issues, the pull request will be created.

GitHub Super Linter basically takes care of configuring GitHub repositories to run a GitHub Action for each new pull request. It packages a number of previously available open source linters into a Docker container that is called by GitHub Actions. Super Linter supports many languages, including JavaScript, Python3, Perl, TypeScript, Golang, and many others.

To better suit Super Linter to your organization's guidelines, you can provide template rule files for the linters you use by copying them into .github/linters. If no custom rule files are provided, Super Linter will use its own default rule files. Similarly, Super Linter allows you to disable specific linters and rules to ignore certain errors or warnings.

Super Linter also includes many customization options that can be set using environment variables. For example, setting VALIDATE_ALL_CODEBASE to true will cause all files to be linted, as opposed to only new and modified files. A number of flags allow you to enable or disable linting on a language-by-language basis.

According to GitHub, Super Linter will help establish sound coding practices across languages and will make collaboration more effective by reducing the amount of work spent on pull requests.

GitHub competitor GitLab also supports a feature similar to GitHub Super Linter through its Code Quality component. GitLab relies on CodeClimate engines to provide automated code review before merging to master. GitLab's solution does not support as many languages as Super Linter, but GitLab said they are working to extend language support in Code Quality.

As a final note, GitHub Super Linter may be seen as another step in the direction of moving your entire IDE to the Cloud. In the same line, a few months ago GitHub introduced GitHub Codespaces, which provide a fully-configured Visual Studio Code-based environment inside of GitHub.

Rate this Article

Adoption
Style

BT