Skip to content

Commit 89a40d6

Browse files
authored
πŸ§‘β€πŸ’» Set up the Markdown files linter (#15)
1 parent f44715b commit 89a40d6

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

β€Ž.github/PULL_REQUEST_TEMPLATE.mdβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- markdownlint-disable MD041 -->
2+
13
## Description
24

35
<!--Provide a concise description of the changes made -->
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint Markdown files
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**.md'
9+
pull_request:
10+
branches:
11+
- main
12+
paths:
13+
- '**.md'
14+
15+
jobs:
16+
lint:
17+
name: Lint Markdown files
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out πŸŽ‰
21+
uses: actions/checkout@v4.1.1
22+
- name: Run `markdownlint` 🎨
23+
uses: DavidAnson/markdownlint-cli2-action@v13.0.0
24+
with:
25+
config: .markdownlint.jsonc
26+
globs: '**/*.md'

β€Ž.markdownlint.jsoncβ€Ž

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Full list of rules and their options available at:
2+
// https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.jsonc
3+
4+
{
5+
// Default state for all rules
6+
"default": true,
7+
8+
// MD013/line-length - Line length
9+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md
10+
"MD013": {
11+
"line_length": 80,
12+
"stern": true,
13+
"tables": false
14+
},
15+
16+
// MD014/commands-show-output - Dollar signs used before commands without showing output
17+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md014.md
18+
"MD014": false,
19+
20+
// MD043/required-headings/required-headers - Required heading structure
21+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md043.md
22+
"MD043": false
23+
}

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ repos:
1717
- --no-ensure-ascii
1818
- --no-sort-keys
1919
- id: trailing-whitespace
20+
- repo: https://github.com/DavidAnson/markdownlint-cli2
21+
rev: 'v0.10.0'
22+
hooks:
23+
- id: markdownlint-cli2
2024
- repo: https://github.com/psf/black
2125
rev: '23.10.1'
2226
hooks:

0 commit comments

Comments
Β (0)