Lint
Linters ensure source code follows best practices.
lintBash
Lints Bash code with ShellCheck.
Types:
- lintBash:
- enable (
boolean): Optional. Defaults tofalse. - targets (
listOf str): Optional. Files or directories (relative to the project) to lint. Defaults to the entire project.
- enable (
Example:
lintGitMailMap
Lint the Git mailmap of the project with MailMap Linter.
Types:
- lintGitMailmap:
- enable (
boolean): Optional. Defaults tofalse. - exclude (
str): Optional. If the excludes aren't too many then useexcludeinstead of the exclude file (.mailmap-exclude). Defaults to^$.
- enable (
Example:
lintNix
Lints Nix code with statix.
Types:
- lintNix:
- enable (
boolean): Optional. Defaults tofalse. - targets (
listOf str): Optional. Files or directories (relative to the project) to lint. Defaults to the entire project.
- enable (
Example:
lintTerraform
Lint Terraform code with TFLint.
Types:
- lintTerraform:
- config (
str): Optional. Path to a TFLint configuration file. Defaults to config.hcl. - modules (
attrsOf moduleType): Optional. Path to Terraform modules to lint. Defaults to{ }.
- config (
- moduleType (
submodule):- setup (
listOf package): Optional. Makes Environment or Makes Secrets tosource(as in Bash'ssource) before anything else. Defaults to[ ]. - src (
str): Path to the Terraform module. - version (
enum [ "0.14" "0.15" "1.0" ]): Terraform version your module is built with.
- setup (
Example:
lintWithAjv
Warning
This function is only available on Linux at the moment.
Lints JSON and YAML data files with JSON Schemas. It uses ajv-cli.
Types:
- lintWithAjv (
attrsOf schemaType): Optional. Definitions of schema and associated data to lint. Defaults to{ }. - schemaType (
submodule):- schema (
str): Required. Path to the JSON Schema. - targets (
listOf str): Required. YAML or JSON data files to lint withschema.
- schema (
Example: