Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspect.build/llms.txt

Use this file to discover all available pages before exploring further.

API for declaring a shellcheck lint aspect that visits sh_binary, sh_library, and sh_test rules. Typical usage: Shellcheck is provided as a built-in tool by rules_lint. To use the built-in version, create the linter aspect, typically in tools/lint/linters.bzl:
load("@aspect_rules_lint//lint:shellcheck.bzl", "lint_shellcheck_aspect")

shellcheck = lint_shellcheck_aspect(
    binary = Label("@aspect_rules_lint//lint:shellcheck_bin",
    config = Label("//:.shellcheckrc"),
)

Function: shellcheck_action

Run shellcheck as an action under Bazel. Based on https://github.com/koalaman/shellcheck/blob/master/shellcheck.1.md

Parameters

ctx
unknown
required
Bazel Rule or Aspect evaluation context
executable
unknown
required
label of the the shellcheck program
srcs
unknown
required
bash files to be linted
config
unknown
required
label of the .shellcheckrc file
stdout
unknown
required
output file containing stdout of shellcheck
exit_code
unknown
default:"None"
output file containing shellcheck exit code. If None, then fail the build when vale exits non-zero. See https://github.com/koalaman/shellcheck/blob/master/shellcheck.1.md#return-values
options
unknown
default:"[]"

Function: lint_shellcheck_aspect

A factory function to create a linter aspect. Attrs: binary: a shellcheck executable. config: the .shellcheckrc file

Parameters

binary
unknown
required
config
unknown
required
rule_kinds
unknown
default:"[\"sh_binary\", \"sh_library\", \"sh_test\"]"