ci: lint markdown files
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
517262dfde
commit
50b36a50aa
@ -7,9 +7,10 @@ import (
|
||||
"universe.dagger.io/alpine"
|
||||
"universe.dagger.io/docker"
|
||||
"universe.dagger.io/go"
|
||||
"universe.dagger.io/go/golangci"
|
||||
|
||||
"github.com/dagger/dagger/ci/pkg/golangci"
|
||||
"github.com/dagger/dagger/ci/pkg/shellcheck"
|
||||
"github.com/dagger/dagger/ci/pkg/markdownlint"
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
@ -96,6 +97,11 @@ dagger.#Plan & {
|
||||
source: _source
|
||||
}
|
||||
|
||||
markdown: markdownlint.#Lint & {
|
||||
source: _source
|
||||
files: ["./docs", "README.md"]
|
||||
}
|
||||
|
||||
cue: docker.#Build & {
|
||||
steps: [
|
||||
alpine.#Build & {
|
||||
|
36
ci/pkg/markdownlint/markdownlint.cue
Normal file
36
ci/pkg/markdownlint/markdownlint.cue
Normal file
@ -0,0 +1,36 @@
|
||||
package markdownlint
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
|
||||
"universe.dagger.io/docker"
|
||||
)
|
||||
|
||||
#Lint: {
|
||||
// Source code
|
||||
source: dagger.#FS
|
||||
|
||||
// shellcheck version
|
||||
version: *"0.31.1" | string
|
||||
|
||||
// Files to lint
|
||||
files: [...string]
|
||||
|
||||
_image: docker.#Pull & {
|
||||
source: "tmknom/markdownlint:\(version)"
|
||||
}
|
||||
|
||||
container: docker.#Run & {
|
||||
input: _image.output
|
||||
mounts: "source": {
|
||||
dest: "/src"
|
||||
contents: source
|
||||
}
|
||||
workdir: "/src"
|
||||
command: {
|
||||
// FIXME: this should not be required
|
||||
name: "markdownlint"
|
||||
args: files
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user