Skip to content

Commit d2c96d9

Browse files
committed
Add markdown linting to GitHub workflow
Commit introduces initial set of rules for checking formatting of markdown files as part of GitHub workflow. The rules are: - first line is top-level heading - there is only one top-level heading in the document
1 parent d8a7d16 commit d2c96d9

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

.copy-edit-stylesheet-checklist.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Basic checklist/stylesheet used for copy editing BOLTs
22

33
Contributions should comply with this checklist/stylesheet to maintain correct, clear, consistent, and concise BOLTS.
4+
Items marked as 'lint' can be automatically checked by running `tools/lint.sh`.
45

6+
- headings
7+
- first line is top-level heading (lint)
8+
- there is only one top-level heading in the document (lint)
59
- spelling
610
- run `tools/spellcheck.sh --check [0-9][0-9]-*.md`
711
- update `.aspell.en.pws` with any missing words

.github/workflows/checks.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on: [push, pull_request]
2+
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: DavidAnson/markdownlint-cli2-action@v15
9+
with:
10+
globs: |
11+
??-*.md
12+
proposals/*.md

.markdownlint.jsonc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"default": false,
3+
4+
// There should be only one top-level heading.
5+
"MD025": true,
6+
7+
// The first line should be top-level heading.
8+
"MD041": true
9+
}

tools/lint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
# https://github.com/DavidAnson/markdownlint-cli2
4+
5+
markdownlint-cli2 ??-*.md proposals/*.md

0 commit comments

Comments
 (0)