linting
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/stuttgart-things/dagger/linting@v0.80.0Entrypoint
Return Type
Linting Example
dagger -m github.com/stuttgart-things/dagger/linting@a2d7c6957b80ad9091157c134df2ee3943c2d76a call \
func (m *MyModule) Example() *dagger.Linting {
return dag.
Linting()
}@function
def example() -> dagger.Linting:
return (
dag.linting()
)@func()
example(): Linting {
return dag
.linting()
}Types
Linting 🔗
baseImage() 🔗
Return Type
String ! Example
dagger -m github.com/stuttgart-things/dagger/linting@a2d7c6957b80ad9091157c134df2ee3943c2d76a call \
base-imagefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Linting().
BaseImage(ctx)
}@function
async def example() -> str:
return await (
dag.linting()
.base_image()
)@func()
async example(): Promise<string> {
return dag
.linting()
.baseImage()
}lintYaml() 🔗
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| configPath | String | ".yamllint" | LintYAML lints YAML files in the provided directory |
| outputFile | String | "yamllint-findings.txt" | No description provided |
Example
dagger -m github.com/stuttgart-things/dagger/linting@a2d7c6957b80ad9091157c134df2ee3943c2d76a call \
lint-yaml --src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.File {
return dag.
Linting().
LintYaml(src)
}@function
def example(src: dagger.Directory) -> dagger.File:
return (
dag.linting()
.lint_yaml(src)
)@func()
example(src: Directory): File {
return dag
.linting()
.lintYaml(src)
}runPreCommit() 🔗
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| configPath | String | ".pre-commit-config.yaml" | LintPreCommit runs pre-commit hooks on the provided directory |
| outputFile | String | "pre-commit-findings.txt" | No description provided |
| skipHooks | [String ! ] | - | No description provided |
Example
dagger -m github.com/stuttgart-things/dagger/linting@a2d7c6957b80ad9091157c134df2ee3943c2d76a call \
run-pre-commit --src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.File {
return dag.
Linting().
RunPreCommit(src)
}@function
def example(src: dagger.Directory) -> dagger.File:
return (
dag.linting()
.run_pre_commit(src)
)@func()
example(src: Directory): File {
return dag
.linting()
.runPreCommit(src)
}scanSecrets() 🔗
ScanSecrets runs detect-secrets scan on the provided directory and returns a JSON findings report.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| outputFile | String | "secret-findings.json" | No description provided |
| excludeFiles | String | - | No description provided |
Example
dagger -m github.com/stuttgart-things/dagger/linting@a2d7c6957b80ad9091157c134df2ee3943c2d76a call \
scan-secrets --src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.File {
return dag.
Linting().
ScanSecrets(src)
}@function
def example(src: dagger.Directory) -> dagger.File:
return (
dag.linting()
.scan_secrets(src)
)@func()
example(src: Directory): File {
return dag
.linting()
.scanSecrets(src)
}autoFixSecrets() 🔗
AutoFixSecrets uses a Dagger AI agent to analyze detect-secrets findings and add pragma: allowlist secret comments to flagged lines.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| excludeFiles | String | - | No description provided |
Example
dagger -m github.com/stuttgart-things/dagger/linting@a2d7c6957b80ad9091157c134df2ee3943c2d76a call \
auto-fix-secrets --src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.Directory {
return dag.
Linting().
AutoFixSecrets(src)
}@function
def example(src: dagger.Directory) -> dagger.Directory:
return (
dag.linting()
.auto_fix_secrets(src)
)@func()
example(src: Directory): Directory {
return dag
.linting()
.autoFixSecrets(src)
}lintMarkdown() 🔗
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| configPath | String | ".mdlrc" | LintMarkdown lints Markdown files in the provided directory |
| outputFile | String | "markdown-findings.txt" | No description provided |
Example
dagger -m github.com/stuttgart-things/dagger/linting@a2d7c6957b80ad9091157c134df2ee3943c2d76a call \
lint-markdown --src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.File {
return dag.
Linting().
LintMarkdown(src)
}@function
def example(src: dagger.Directory) -> dagger.File:
return (
dag.linting()
.lint_markdown(src)
)@func()
example(src: Directory): File {
return dag
.linting()
.lintMarkdown(src)
}