Skip to content

Commit a6f7313

Browse files
committed
workflows: use new and maintained mdl implementation
The currently used action to lint markdown files does not properly produce annotations, which would be really useful to have. Use a newer version that does support annotating files. Signed-off-by: Luca Zeuch <[email protected]>
1 parent 71e8431 commit a6f7313

File tree

3 files changed

+63
-21
lines changed

3 files changed

+63
-21
lines changed

.github/workflows/lint.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@ name: Lint
22

33
on:
44
pull_request:
5-
paths:
6-
- 'content/**/*.md'
75

86
jobs:
9-
lint-markdown:
7+
markdown:
108
runs-on: ubuntu-latest
119
steps:
12-
- name: Checkout repository
13-
uses: actions/checkout@v4
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
1413
- name: Lint markdown files
15-
uses: actionshub/markdownlint@main
14+
uses: DavidAnson/markdownlint-cli2-action@v19
15+
continue-on-error: true
1616
with:
17-
filesToIgnoreRegex: 'all-commands.md|scripts/.*|.github/.*'
17+
globs: |
18+
content/**/*.md
19+
!content/docs/core/all-commands.md
20+
config: config/.markdownlint.yaml

.mdlrc

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,91 @@
11
# Enable all rules; we'll configure some of them below.
2-
all
2+
default: true
33

44
# MD001: Header levels should only increment by one level at a time.
55
# Normally, this is a fair rule, but it does not quite work for our cases,
66
# especially in our humongous functions list. So disable it.
7-
exclude_rule 'MD001'
7+
MD001: false
88

99
# MD002: First header should be a top level header.
1010
# Some files do not have a top-level header, because it doesn't make sense for
1111
# them, or just looks incredibly stupid on the rendered page. So disable this
1212
# entire rule.
13-
exclude_rule 'MD002'
13+
MD002: false
1414

1515
# MD004: Unordered list style.
1616
# Use dashes for unordered lists. All lists. Even sublists.
17-
rule 'MD004', :style => :dash
17+
MD004:
18+
style: "dash"
1819

1920
# MD013: Line length.
2021
# Allow lines to be up to 120 characters long, see the .editorconfig file.
2122
# We also ignore code blocks, because they are often long and should not be
2223
# wrapped at all. Same goes for tables.
23-
rule 'MD013', :line_length => 120, :ignore_code_blocks => true, :tables => false
24+
MD013:
25+
line_length: 120
26+
code_blocks: false
27+
tables: false
2428

2529
# MD024: Multiple headers with the same content.
2630
# Allow multiple headers with the same content so long they are under different
2731
# parent headers.
28-
rule 'MD024', :allow_different_nesting => true
32+
MD024:
33+
siblings_only: true
2934

3035
# MD026: Trailling punctuation in header.
3136
# Allow question marks (FAQ-style).
32-
rule 'MD026', :punctuation => '.,;:!'
37+
MD026:
38+
punctuation: ".,;:!"
3339

3440
# MD029: Ordered list item prefix.
3541
# Should increase in numerical order.
36-
rule 'MD029', :style => :ordered
42+
MD029:
43+
style: "ordered"
3744

3845
# MD033: Inline HTML.
3946
# Allow certain HTML elements, because we use them for nicer page layout.
40-
rule 'MD033', :allowed_elements => 'center, div, sup, br, kbd'
47+
MD033:
48+
allowed_elements: ["center", "div", "sup", "br", "kbd"]
4149

4250
# MD037: Spaces inside emphasis markers.
4351
# This rule is broken. See https://github.com/markdownlint/markdownlint/issues/84
44-
exclude_rule 'MD037'
52+
MD037: false
4553

4654
# MD041: First line in file should be a top-level header.
4755
# See comment to MD002. It makes no sense to set this to H2 for similar reasons,
4856
# we have TOML frontmatter with an automatic h1 in the rendered page.
49-
exclude_rule 'MD041'
57+
MD041: false
58+
59+
# MD048: Code fence style.
60+
# Use backticks for code fences.
61+
MD048:
62+
style: "backtick"
63+
64+
# MD049: Emphasis style. (Italics)
65+
# Use asterisks for italics.
66+
# MD049:
67+
# style: "asterisk"
68+
# FIXME: Re-enable this rule once we have fixed all the italics in the docs.
69+
MD049: false
70+
71+
# MD050: Strong style.
72+
# Use double asterisks for bold text.
73+
MD050:
74+
style: "asterisk"
75+
76+
# MD051: Link fragments should be valid.
77+
# Disable this rule, because Hugo already checks for (potentially) broken links.
78+
MD051: false
79+
80+
# MD052: Reference links and images should use a label that is defined.
81+
# Similar reasons as MD051, Hugo already checks for broken links.
82+
MD052: false
83+
84+
# MD053: Link and image reference definitions should be needed.
85+
# Similar reasons as MD051, Hugo already checks for broken links.
86+
MD053: false
87+
88+
# MD054: Link and image style.
89+
# Disable this rule, because it is very extensive and thus painful to configure.
90+
# By extension, also very painful to fix.
91+
MD054: false

0 commit comments

Comments
 (0)