Skip to content

Commit 3fbd290

Browse files
committed
Add markdownlint-cli2 check
Hopefully this checks for dumb errors? No, it doesn't detect the issue fixed by d2be6d6. Oh well.
1 parent f9dd4fb commit 3fbd290

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

.markdownlint-cli2.jsonc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
// I have not read this I just asked AI to make markdownlint-cli2 compatible
3+
// with mdformat.
4+
"config": {
5+
// MD003: mdformat always uses ATX style headings (e.g., ## Heading)
6+
"MD003": { "style": "atx" },
7+
8+
// MD004: mdformat defaults to dashes (-) for unordered lists
9+
"MD004": { "style": "dash" },
10+
11+
// MD007: mdformat uses 2-space indentation for unordered lists
12+
"MD007": { "indent": 2 },
13+
14+
// MD013: mdformat does not wrap lines by default (Semantic Line Breaks)
15+
"MD013": false,
16+
17+
// MD029: mdformat uses "1." for all ordered list items to minimize diffs
18+
"MD029": { "style": "one" },
19+
20+
// MD046: mdformat reformats indented code blocks into fenced code blocks
21+
"MD046": { "style": "fenced" },
22+
23+
// MD049/MD050: mdformat uses underscores (_) for italics and asterisks (**) for bold
24+
"MD049": { "style": "underscore" },
25+
"MD050": { "style": "asterisk" },
26+
27+
// (Not AI from here on)
28+
// Allow bare URLS
29+
"MD034": false,
30+
}
31+
}

flake.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,18 @@
5757
};
5858

5959
devShells.default = pkgs.mkShell {
60-
packages = [ pkgs.hugo ];
60+
packages = with pkgs; [ hugo markdownlint-cli2 ];
6161
};
62+
63+
checks.markdown-lint =
64+
pkgs.runCommand "markdown-lint"
65+
{
66+
buildInputs = [ pkgs.markdownlint-cli2 ];
67+
}
68+
''
69+
markdownlint-cli2 "${self}/**/*.md"
70+
touch $out
71+
'';
6272
}
6373
);
6474
}

0 commit comments

Comments
 (0)