ci: lint markdown files

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2022-04-01 12:07:55 -07:00
parent 517262dfde
commit 50b36a50aa
3 changed files with 43 additions and 1 deletions

View File

@ -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 & {

View 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
}
}
}