super linter

Microsoft owned Github recently launched a new action to its Github Actions pipeline to lint the codebase. This service was built and used by the Github Internal DevOps team, is now open-sourced and introduced as new GitHub Action. With the help of this new feature maintains consistency in the codebase. This Super linter supports the majority of mainstream languages and file types such as Javascript, Python, Java, Go, XML, YAML, CSS, Ruby, and others. The list can found in the Super Linter Repo.

Super linter is a combination of various linters written in bash. This Super linter actions goal is to,

  • Prevent broken code from being uploaded to the default branch (usually master)
  • Help establish coding best practices across multiple languages
  • Build guidelines for code layout and format
  • Automate the process to help streamline code reviews

When Github Action executed, Super linter action will flag issues in the console. Possible fixes are suggested but not fixed automatically, and the pull request will fail.

Sample Github Action flow for linting

- name: Lint Code Base
        uses: docker://github/super-linter:v2.1.0
        env:
          VALIDATE_ALL_CODEBASE: true
          VALIDATE_JAVASCRIPT_ES: true

The above action will pull the super-linter:v2.1.0 image down from DockerHub and run the GitHub Super-Linter. VALIDATE_ALL_CODEBASE Will parse the entire repository and find all files to validate across all types. VALIDATE_JAVASCRIPT_ES Flag to enable or disable the linting process of the language. (Utilizing: eslint)

Complete Action flow Example can found in Super Linter’s README.md

We can also run this Super Linter Locally, follow steps mentioned here, Run Super Linter Local

Read About Github Mobile App

1 COMMENT

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.