Sign inSign up

rpmoore/okf-lint

By rpmoore

Updated about 2 months ago

A CLI linter for Open Knowledge Format (OKF) documentation bundles

Image
Languages & frameworks
Machine learning & AI
Developer tools
1

1.4K

rpmoore/okf-lint repository overview

okf-lint

A CLI linter for Open Knowledge Format (OKF) documentation bundles. Walks a directory of markdown files, checks frontmatter, index.md/log.md structure, and general markdown hygiene (line length, trailing whitespace, hard tabs, etc.), and emits compiler-style diagnostics with a nonzero exit code on violations — built for CI.

Source and issue tracker: github.com/rpmoore/okf-lint

Supported tags

Multi-platform (linux/amd64 and linux/arm64) builds — docker pull resolves the right architecture for your machine automatically:

  • latest — most recent published build
  • <commit-sha> — pinned to the exact commit it was built from
docker pull rpmoore/okf-lint

Pull a specific SHA tag to pin an exact build instead of tracking latest:

docker pull rpmoore/okf-lint:<commit-sha>

Usage

The container's entrypoint is the okf-lint binary, so it takes the same arguments and subcommands as the CLI. Mount the directory you want to scan into the container as a volume, then pass that mount path as the argument:

docker run --rm -v "$PWD/docs":/data rpmoore/okf-lint /data
concept-a.md:7: line has trailing whitespace
concept-b.md:1: missing or invalid YAML frontmatter (spec: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#41-frontmatter)

Exit codes: 0 clean, 1 violations found, 2 usage/IO error.

fmt --check works the same way, since like the default lint mode it only reads:

docker run --rm -v "$PWD/docs":/data rpmoore/okf-lint fmt /data --check

Writing fixes back with plain fmt is different: the image runs as a non-root user (uid 65532, inherited from the cgr.dev/chainguard/static base), so it typically can't write to a bind-mounted host directory owned by your own user — add --user "$(id -u):$(id -g)" so the container writes as you instead:

docker run --rm -v "$PWD/docs":/data --user "$(id -u):$(id -g)" rpmoore/okf-lint fmt /data

If you're only linting (not writing fixes back with fmt), mount read-only with -v "$PWD/docs":/data:ro.

License

Apache-2.0, see LICENSE.

Tag summary

Content type

Image

Digest

sha256:fe92390c2

Size

1.6 MB

Last updated

about 2 months ago

docker pull rpmoore/okf-lint