Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 1.63 KB

File metadata and controls

60 lines (45 loc) · 1.63 KB

Lint of code base

This repo uses the super-linter to check the code base syntax and format on different file types.

Linters in GitHub Action

When you create a pull request, super-linter will automatically be run as a GitHub Action. If any of the linters give an error, this will be shown in the action connected to the pull request.

Run super-linter locally

Before you create a pull request, you are encouraged to run the super-linter locally which is possible since it is available as a container. Using Docker, a local run would be invoked by:

docker run --rm \
  -v "$PWD":/tmp/lint \
  -e RUN_LOCAL=true \
  --env-file .github/super-linter.env \
  ghcr.io/super-linter/super-linter:slim-v8

Run super-linter interactively

Sometimes it is more convenient to run super-linter interactively. To do so with Docker:

docker run -it --rm \
  -v "$PWD":/tmp/lint \
  -w /tmp/lint \
  --env-file .github/super-linter.env \
  --entrypoint /bin/bash \
  ghcr.io/super-linter/super-linter:slim-v8

Then from the container terminal, the following commands can lint the the code base for different file types:

# Lint Dockerfile files
hadolint $(find -type f -name Dockerfile\*)

# Lint Dockerfile files (alternative command)
find -type f -name Dockerfile\* -exec hadolint {} +

# Lint JSON files
eslint --no-eslintrc -c /action/lib/.automation/.eslintrc.yml --ext .json .

# Lint Markdown files
markdownlint .

# Lint YAML files
yamllint .