Skip to content

Linters and formatters ​

Functions of the tools module at v0.3.2. Each returns what a command runs in; import it with import * as tools from "tools".

shellcheck ​

ShellCheck, koalaman/shellcheck-alpine:v0.11.0 by default.

lask
shellcheck(
  --image: Environment = #koalaman/shellcheck-alpine:v0.11.0,
  --opts: String | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #koalaman/shellcheck-alpine:<tag>.
  • --opts SHELLCHECK_OPTS, e.g. "-e SC1091".
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any other variable; below --with and the named parameters.

Returns Runnable: The environment, for command { "shellcheck" } on ... or $[...].

Image koalaman/shellcheck-alpine:v0.11.0

Command words shellcheck: import command { "shellcheck" } from "tools"

bash
lask eval shellcheck --opts "-e SC1091"

lib/lint.lask

hadolint ​

hadolint, the Dockerfile linter, hadolint/hadolint:v2.15.1-alpine by default. A .hadolint.yaml in the project configures it.

lask
hadolint(
  --image: Environment = #hadolint/hadolint:v2.15.1-alpine,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #hadolint/hadolint:<tag>.
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any other variable, e.g. HADOLINT_FAILURE_THRESHOLD; below --with.

Returns Runnable: The environment, for command { "hadolint" } on ... or $[...].

Image hadolint/hadolint:v2.15.1-alpine

Command words hadolint: import command { "hadolint" } from "tools"

bash
lask eval hadolint

lib/lint.lask

tflint ​

TFLint, ghcr.io/terraform-linters/tflint:v0.64.0 by default. tflint --init downloads the plugins .tflint.hcl names, from GitHub.

lask
tflint(
  --image: Environment = #ghcr.io/terraform-linters/tflint:v0.64.0,
  --github_token: String | Null = <secret>,
  --cache_dir: String | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #ghcr.io/terraform-linters/tflint:<tag>.
  • --github_token!! GITHUB_TOKEN, which lifts GitHub's rate limit on plugin downloads; masked in the command log.
  • --cache_dir Host directory mounted at /cache; plugins are kept in /cache/tflint (TFLINT_PLUGIN_DIR).
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any other variable; below --with and the named parameters.

Returns Runnable: The environment, for command { "tflint" } on ... or $[...].

Image ghcr.io/terraform-linters/tflint:v0.64.0

Command words tflint: import command { "tflint" } from "tools"

bash
lask eval tflint --cache_dir /tmp/cache

lib/lint.lask

golangci_lint ​

golangci-lint, golangci/golangci-lint:v2.14.0 by default, with the Go it was built with. The mounted project is trusted by Git (safe.directory), since the linters that read history need it.

lask
golangci_lint(
  --image: Environment = #golangci/golangci-lint:v2.14.0,
  --cache_dir: String | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #golangci/golangci-lint:<tag>.
  • --cache_dir Host directory mounted at /cache: golangci-lint's cache (/cache/golangci-lint), and Go's module and build caches (/cache/mod, /cache/build), shared with go().
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any other variable; below --with and the named parameters.

Returns Runnable: The environment, for command { "golangci-lint" } on ... or $[...].

Image golangci/golangci-lint:v2.14.0

Command words golangci-lint: import command { "golangci-lint" } from "tools"

bash
lask eval golangci_lint --cache_dir /tmp/cache

lib/lint.lask

ruff ​

Ruff, the Python linter and formatter, ghcr.io/astral-sh/ruff:0.16.9-alpine by default.

lask
ruff(
  --image: Environment = #ghcr.io/astral-sh/ruff:0.16.9-alpine,
  --cache_dir: String | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #ghcr.io/astral-sh/ruff:<tag>.
  • --cache_dir Host directory mounted at /cache; Ruff's cache is /cache/ruff (RUFF_CACHE_DIR) instead of .ruff_cache in the project.
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any other variable; below --with and the named parameters.

Returns Runnable: The environment, for command { "ruff" } on ... or $[...].

Image ghcr.io/astral-sh/ruff:0.16.9-alpine

Command words ruff: import command { "ruff" } from "tools"

bash
lask eval ruff

lib/lint.lask

actionlint ​

actionlint, the GitHub Actions workflow linter, rhysd/actionlint:1.7.12 by default.

lask
actionlint(
  --image: Environment = #rhysd/actionlint:1.7.12,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #rhysd/actionlint:<tag>.
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any other variable; below --with.

Returns Runnable: The environment, for command { "actionlint" } on ... or $[...].

Image rhysd/actionlint:1.7.12

Command words actionlint: import command { "actionlint" } from "tools"

bash
lask eval actionlint

lib/lint.lask

Released under the MIT License.