Rumdl GitLab CI Component¶
A GitLab CI component for rumdl - a high-performance Markdown linter written in Rust that ensures your Markdown files follow best practices and standards.
Features¶
- High-Performance Linting: Fast Rust-based Markdown validation and formatting checks
- Comprehensive Rules: Extensive set of Markdown linting rules and style checks
- Custom Configuration: Support for local and remote configuration files
- Flexible Arguments: Pass additional flags directly to rumdl
- Remote Configuration: Download and use configuration files from remote URLs
- Configurable Job Settings: Customise job name, stage, and container image
- Autofix Workflow: Optional component that runs rumdl with
--fixand pushes changes back to the branch
Usage¶
Basic Usage¶
With Custom Configuration¶
include:
- component: $CI_SERVER_FQDN/niclas-zone/ci/rumdl/main@latest
inputs:
RUMDL_CONFIG: ".rumdl.toml"
RUMDL_EXTRA_ARGS: "--disable MD013"
stages:
- lint
With Remote Configuration¶
include:
- component: $CI_SERVER_FQDN/niclas-zone/ci/rumdl/main@latest
inputs:
RUMDL_REMOTE_CONFIG: "https://gitlab.com/niclas-zone/ci/rumdl/-/raw/main/config/rumdl.toml"
stages:
- lint
Running the Autofix Job¶
The component also ships with an autofix job that re-runs rumdl with --fix when the lint job fails, commits the results, and pushes them back to the branch. Store a base64-encoded deploy key with push access in a masked CI variable named BOT_SSH_KEY so the job can authenticate.
include:
- component: $CI_SERVER_FQDN/niclas-zone/ci/rumdl/main@latest
- component: $CI_SERVER_FQDN/niclas-zone/ci/rumdl/autofix@latest
inputs:
rumdl_job_name: "markdown" # must match the job name from the lint component
stages:
- lint
variables:
BOT_SSH_KEY: $BOT_SSH_KEY # base64 private key used for pushing autofix commits
The autofix job runs when: on_failure, so it only triggers if the referenced rumdl job fails. You can customise commit metadata and signing behaviour through the component inputs described below.
Inputs¶
Lint Component (main)¶
| Input | Description | Default |
|---|---|---|
job_name |
Name of the CI job | "markdown" |
stage |
Pipeline stage | "lint" |
image |
Docker image for rumdl | "registry.gitlab.com/niclas-zone/ctr/rumdl:0.0.198" |
RUMDL_EXTRA_ARGS |
Extra arguments for rumdl | "" |
RUMDL_CONFIG |
Path to local rumdl config file | "" |
RUMDL_REMOTE_CONFIG |
URL to download rumdl config file | "" |
Autofix Component (autofix)¶
| Input | Description | Default |
|---|---|---|
job_name |
Name of the CI job that performs the autofix | "markdown:autofix" |
stage |
Pipeline stage for the autofix job | "lint" |
image |
Docker image for rumdl | "registry.gitlab.com/niclas-zone/ctr/rumdl:0.0.198" |
rumdl_job_name |
Rumdl lint job that must fail before autofix runs | "markdown" |
RUMDL_EXTRA_ARGS |
Extra arguments forwarded to rumdl check --fix |
"" |
RUMDL_CONFIG |
Local rumdl config path | "" |
RUMDL_REMOTE_CONFIG |
URL used to download a config before fixing | "" |
commit_message |
Commit message used for autofix pushes | "chore(rumdl): apply rumdl autofix" |
git_author_name |
Git author name for autofix commits | "Niclas Bot" |
git_author_email |
Git author email for autofix commits | "bot@nheinz.dev" |
git_signing_ssh |
Enables SSH-based commit signing (true / false) |
"true" |
Note: The autofix job requires the
BOT_SSH_KEYCI variable to contain a base64-encoded private SSH key with push access to the project repository.