Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ trunk check enable {linter}
| Kotlin | [detekt], [ktlint] |
| Kubernetes | [kube-linter] |
| Lua | [stylua] |
| Markdown | [deno], [markdownlint], [markdownlint-cli2], [markdown-link-check], [markdown-table-prettify], [prettier], [remark-lint] |
| Markdown | [deno], [markdownlint], [markdownlint-cli2], [markdown-link-check], [markdown-table-prettify], [prettier], [remark-lint], [rumdl] |
| Nix | [nixpkgs-fmt] |
| package.json | [sort-package-json] |
| Perl | [perlcritic], [perltidy] |
Expand Down
55 changes: 55 additions & 0 deletions linters/rumdl/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: 0.1
downloads:
- name: rumdl
downloads:
- os:
linux: unknown-linux-gnu
macos: apple-darwin
cpu:
x86_64: x86_64
arm_64: aarch64
url: https://github.com/rvben/rumdl/releases/download/v${version}/rumdl-v${version}-${cpu}-${os}.tar.gz
- os: windows
cpu: x86_64
url: https://github.com/rvben/rumdl/releases/download/v${version}/rumdl-v${version}-x86_64-pc-windows-msvc.zip
tools:
definitions:
- name: rumdl
download: rumdl
known_good_version: 0.1.42
shims: [rumdl]
health_checks:
- command: rumdl --version
parse_regex: ${semver}
lint:
definitions:
- name: rumdl
files: [markdown]
tools: [rumdl]
description: A high-performance Markdown linter and formatter written in Rust
commands:
- name: lint
output: regex
parse_regex: (?P<path>.*):(?P<line>\d+):(?P<col>\d+):\s+\[(?P<code>[^\]]+)\]\s+(?P<message>.*)
run: rumdl check ${target}
success_codes: [0, 1]
batch: true
cache_results: true
read_output_from: stdout
- name: fmt
output: rewrite
run: rumdl fmt ${target}
success_codes: [0]
batch: true
cache_results: true
formatter: true
in_place: true
suggest_if: config_present
direct_configs:
- .rumdl.toml
- rumdl.toml
issue_url_format: https://rumdl.dev/rules/{}
known_good_version: 0.1.42
version_command:
parse_regex: ${semver}
run: rumdl version
4 changes: 4 additions & 0 deletions linters/rumdl/rumdl.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { linterCheckTest, linterFmtTest } from "tests";

linterCheckTest({ linterName: "rumdl" });
linterFmtTest({ linterName: "rumdl" });
11 changes: 11 additions & 0 deletions linters/rumdl/test_data/basic.in.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# bad.md

# This file fails some rules

Line is OK- Make a realy long line that breaks the layout rules completely. Make a realy long line
that breaks
But this should be ignored because of config


Line is too long (over 120) A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A
B C D E F G A B C D E F G A B C D E F G
98 changes: 98 additions & 0 deletions linters/rumdl/test_data/rumdl_v0.1.42_basic.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing linter rumdl test basic 1`] = `
{
"issues": [
{
"code": "MD013",
"column": "81",
"file": "test_data/basic.in.md",
"issueClass": "ISSUE_CLASS_EXISTING",
"issueUrl": "https://rumdl.dev/rules/MD013",
"level": "LEVEL_HIGH",
"line": "10",
"linter": "rumdl",
"message": "Line length 99 exceeds 80 characters",
"targetType": "markdown",
},
{
"code": "MD025",
"column": "3",
"file": "test_data/basic.in.md",
"issueClass": "ISSUE_CLASS_EXISTING",
"issueUrl": "https://rumdl.dev/rules/MD025",
"level": "LEVEL_HIGH",
"line": "3",
"linter": "rumdl",
"message": "Multiple top-level headings (level 1) in the same document [*]",
"targetType": "markdown",
},
{
"code": "MD013",
"column": "81",
"file": "test_data/basic.in.md",
"issueClass": "ISSUE_CLASS_EXISTING",
"issueUrl": "https://rumdl.dev/rules/MD013",
"level": "LEVEL_HIGH",
"line": "5",
"linter": "rumdl",
"message": "Line length 98 exceeds 80 characters",
"targetType": "markdown",
},
{
"code": "MD012",
"column": "1",
"file": "test_data/basic.in.md",
"issueClass": "ISSUE_CLASS_EXISTING",
"issueUrl": "https://rumdl.dev/rules/MD012",
"level": "LEVEL_HIGH",
"line": "9",
"linter": "rumdl",
"message": "Multiple consecutive blank lines between content [*]",
"targetType": "markdown",
},
],
"lintActions": [
{
"command": "fmt",
"fileGroupName": "markdown",
"linter": "rumdl",
"paths": [
"test_data/basic.in.md",
],
"verb": "TRUNK_VERB_FMT",
},
{
"command": "lint",
"fileGroupName": "markdown",
"linter": "rumdl",
"paths": [
"test_data/basic.in.md",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "lint",
"fileGroupName": "markdown",
"linter": "rumdl",
"paths": [
"test_data/basic.in.md",
],
"upstream": true,
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [
{
"column": "1",
"file": "test_data/basic.in.md",
"issueClass": "ISSUE_CLASS_UNFORMATTED",
"level": "LEVEL_HIGH",
"line": "1",
"linter": "rumdl",
"message": "Incorrect formatting, autoformat by running 'trunk fmt'",
},
],
}
`;
15 changes: 15 additions & 0 deletions linters/rumdl/test_data/rumdl_v0.1.42_basic.fmt.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing formatter rumdl test basic 1`] = `
"# bad.md

## This file fails some rules

Line is OK- Make a realy long line that breaks the layout rules completely. Make a realy long line
that breaks
But this should be ignored because of config

Line is too long (over 120) A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A
B C D E F G A B C D E F G A B C D E F G
"
`;
Loading