Skip to content

Commit

Permalink
Add markdown linting to GitHub workflow
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jirijakes committed Feb 23, 2024
1 parent 8c9d4a5 commit c1f8a9d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .copy-edit-stylesheet-checklist.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Basic checklist/stylesheet used for copy editing BOLTs

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

- headings
- first line is top-level heading (lint)
- there is only one top-level heading in the document (lint)
- spelling
- run `tools/spellcheck.sh --check [0-9][0-9]-*.md`
- update `.aspell.en.pws` with any missing words
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v15
with:
globs: |
??-*.md
proposals/*.md
9 changes: 9 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"default": false,

// There should be only one top-level heading.
"MD025": true,

// The first line should be top-level heading.
"MD041": true
}
5 changes: 5 additions & 0 deletions tools/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# https://github.com/DavidAnson/markdownlint-cli2

markdownlint-cli2 ??-*.md proposals/*.md

0 comments on commit c1f8a9d

Please sign in to comment.