markdownlint
See https://github.com/DavidAnson/markdownlint-cli2 for more info. Most configuration should be done in '.markdownlint-cli2.yaml'within the source directory, or provided using 'WithConfig'.
Installation
dagger install github.com/act3-ai/dagger/markdownlint@v0.2.1Entrypoint
Return Type
Markdownlint !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | Source directory containing markdown files to be linted. |
| base | Container | - | Custom container to use as a base container. Must have 'markdownlint-cli2' available on PATH. |
| version | String | "latest" | Version (image tag) to use as a markdownlint-cli2 binary source. |
| config | File | - | Configuration file. |
Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
--src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.Markdownlint {
return dag.
Markdownlint(src)
}@function
def example(src: dagger.Directory, ) -> dagger.Markdownlint:
return (
dag.markdownlint(src)
)@func()
example(src: Directory, ): Markdownlint {
return dag
.markdownlint(src)
}Types
Markdownlint 🔗
base() 🔗
Return Type
Container ! Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
--src DIR_PATH basefunc (m *MyModule) Example(src *dagger.Directory) *dagger.Container {
return dag.
Markdownlint(src).
Base()
}@function
def example(src: dagger.Directory, ) -> dagger.Container:
return (
dag.markdownlint(src)
.base()
)@func()
example(src: Directory, ): Container {
return dag
.markdownlint(src)
.base()
}lint() 🔗
Runs markdownlint-cli2 against a given source directory. Returns a results file and an exit-code.
Return Type
MarkdownLintResults !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| extraArgs | [String ! ] | - | Additional arguments to pass to markdownlint-cli2, without 'markdownlint-cli2' itself. |
Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
--src DIR_PATH lintfunc (m *MyModule) Example(src *dagger.Directory) *dagger.MarkdownlintMarkdownLintResults {
return dag.
Markdownlint(src).
Lint()
}@function
def example(src: dagger.Directory, ) -> dagger.MarkdownlintMarkdownLintResults:
return (
dag.markdownlint(src)
.lint()
)@func()
example(src: Directory, ): MarkdownlintMarkdownLintResults {
return dag
.markdownlint(src)
.lint()
}autoFix() 🔗
AutoFix attempts to fix any linting errors reported by rules that emit fix information. Returns a Changeset that can be used to apply any changes made to the host. e.g. ‘markdownlint-cli2 –fix’.
Return Type
MarkdownLintAutoFixResults !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| extraArgs | [String ! ] | - | Additional arguments to pass to markdownlint-cli2, without 'markdownlint-cli2' itself. |
Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
--src DIR_PATH auto-fixfunc (m *MyModule) Example(src *dagger.Directory) *dagger.MarkdownlintMarkdownLintAutoFixResults {
return dag.
Markdownlint(src).
AutoFix()
}@function
def example(src: dagger.Directory, ) -> dagger.MarkdownlintMarkdownLintAutoFixResults:
return (
dag.markdownlint(src)
.auto_fix()
)@func()
example(src: Directory, ): MarkdownlintMarkdownLintAutoFixResults {
return dag
.markdownlint(src)
.autoFix()
}MarkdownLintResults 🔗
results() 🔗
returns results of markdownlint-cli2 as a file
Return Type
File ! Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
lint \
resultsfunc (m *MyModule) Example() *dagger.File {
return dag.
Markdownlint().
Lint().
Results()
}@function
def example() -> dagger.File:
return (
dag.markdownlint()
.lint()
.results()
)@func()
example(): File {
return dag
.markdownlint()
.lint()
.results()
}check() 🔗
Check for any errors running markdownlint-cli2
Return Type
Void ! Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
lint \
checkfunc (m *MyModule) Example(ctx context.Context) {
return dag.
Markdownlint().
Lint().
Check(ctx)
}@function
async def example() -> None:
return await (
dag.markdownlint()
.lint()
.check()
)@func()
async example(): Promise<void> {
return dag
.markdownlint()
.lint()
.check()
}MarkdownLintAutoFixResults 🔗
changes() 🔗
returns results of markdownlint autofix as a changeset
Return Type
Changeset ! Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
auto-fix \
changesfunc (m *MyModule) Example() *dagger.Changeset {
return dag.
Markdownlint().
AutoFix().
Changes()
}@function
def example() -> dagger.Changeset:
return (
dag.markdownlint()
.auto_fix()
.changes()
)@func()
example(): Changeset {
return dag
.markdownlint()
.autoFix()
.changes()
}fix() 🔗
returns the results of markdownlint autofix as a changeset that can be applied to the host.
Return Type
Changeset ! Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
auto-fix \
fixfunc (m *MyModule) Example() *dagger.Changeset {
return dag.
Markdownlint().
AutoFix().
Fix()
}@function
def example() -> dagger.Changeset:
return (
dag.markdownlint()
.auto_fix()
.fix()
)@func()
example(): Changeset {
return dag
.markdownlint()
.autoFix()
.fix()
}check() 🔗
Returns an error if markdownlint autofix made any changes
Return Type
Void ! Example
dagger -m github.com/act3-ai/dagger/markdownlint@d7d84c7f337dfe0e2934c0eedde2acd7f351e88c call \
auto-fix \
checkfunc (m *MyModule) Example(ctx context.Context) {
return dag.
Markdownlint().
AutoFix().
Check(ctx)
}@function
async def example() -> None:
return await (
dag.markdownlint()
.auto_fix()
.check()
)@func()
async example(): Promise<void> {
return dag
.markdownlint()
.autoFix()
.check()
}