/Lint a Bundle

Lint a Bundle

sunstone lint checks a Bundle and exits, so you can run it before a commit or in CI.

sunstone lint ./docs

It reports:

  • broken links, anchors, Wikilinks and Embeds
  • footnotes that are referenced but never defined
  • malformed Frontmatter
  • in a Bundle that declares okf_version, OKF conformance: a Concept without a type, Frontmatter on a log.md, a Concept its folder's index.md doesn't list, and sources that point at nothing

The Frontmatter checks are the ones the editor shows, so the command line and the app always agree.

An index.md may carry Frontmatter even though the OKF spec says it shouldn't. Sunstone treats it as the page that introduces its folder, so its title names the folder in the Explorer.

Without a folder argument it checks $SUNSTONE_BUNDLE, or else the current directory.

Excluding files

--exclude PATTERN (or -x) skips files: nothing is reported in them, but links into them still resolve. Patterns use gitignore syntax, relative to the Bundle, and the option can be repeated:

sunstone lint docs --exclude tickets/ --exclude 'adr/*.md'

In CI

The exit status is 0 when there are no errors (warnings and info don't count), 1 when there are errors, and 2 on a usage error. Add --json to get the report as JSON.

Sources
  1. Sunstone CHANGELOGhttps://github.com/pothos-dev/sunstone/blob/main/CHANGELOG.md