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:
lintClojure
Lints clojure code with clj-kondo.
Types:
-
lintClojure (
attrsOf (listOf str)
): Optional. Mapping of custom names to lists of paths (relative to the project) to lint.Defaults to
{ }
.
Example:
lintGitCommitMsg
It creates a commit diff between you current branch and the main branch of the repository. All commits included in the diff are linted using Commitlint.
Types:
- lintGitCommitMsg:
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 useexclude
instead 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:
lintPython
Lints Python code with mypy, Prospector, and (if configured) import-linter.
Types:
- lintPython:
- dirOfModules (
attrsOf dirOfModulesType
): Optional. Definitions of directories of python packages/modules to lint. Defaults to{ }
. - imports (
attrsOf importsType
): Optional. Definitions of python packages whose imports will be linted. Defaults to{ }
. - modules (
attrsOf moduleType
): Optional. Definitions of python packages/modules to lint. Defaults to{ }
.
- dirOfModules (
- dirOfModulesType (
submodule
):- config (
atrrs
): Optional.- mypy (
path
): Optional. Path to the Mypy configuration file. Defaults to ./settings-mypy.cfg. - prospector (
path
): Optional. Path to the Prospector configuration file. Defaults to ./settings-prospector.yaml.
- mypy (
- searchPaths (
asIn makeSearchPaths
): Optional. Arguments here will be passed as-is tomakeSearchPaths
. Defaults tomakeSearchPaths
's defaults. - src (
str
): Path to the directory that contains inside many packages/modules.
- config (
- importsType (
submodule
):- config (
str
): Path to the import-linter configuration file. - searchPaths (
asIn makeSearchPaths
): Optional. Arguments here will be passed as-is tomakeSearchPaths
. Defaults tomakeSearchPaths
's defaults. - src (
str
): Path to the package/module.
- config (
- moduleType (
submodule
):- config (
atrrs
): Optional.- mypy (
path
): Optional. Path to the Mypy configuration file. Defaults to ./settings-mypy.cfg. - prospector (
path
): Optional. Path to the Prospector configuration file. Defaults to ./settings-prospector.yaml.
- mypy (
- searchPaths (
asIn makeSearchPaths
): Optional. Arguments here will be passed as-is tomakeSearchPaths
. Defaults tomakeSearchPaths
's defaults. - src (
str
): Path to the package/module.
- config (
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:
lintWithLizard
Using Lizard to check Ciclomatic Complexity and functions length in all supported languages
Types:
-
lintWithLizard (
attrsOf (listOf str)
): Optional. Mapping of custom names to lists of paths (relative to the project) to lint.Defaults to
{ }
.
Example: