Skip to content

Commit bbbfc15

Browse files
committed
add support for checking YAML and Markdown syntax
1 parent 02bf548 commit bbbfc15

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.config/.markdownlint.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Manual for `.markdownlint.yaml` config:
2+
# https://github.com/DavidAnson/markdownlint#optionsconfig
3+
# Config file JSON schema:
4+
# https://github.com/DavidAnson/markdownlint/blob/main/schema/markdownlint-config-schema.json
5+
---
6+
default: true
7+
8+
# Trailing spaces
9+
MD009:
10+
br_spaces: 2
11+
12+
# Line length
13+
MD013:
14+
line_length: 140
15+
tables: false

.config/.yamllint.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Manual for `.yamllint.yaml` config:
2+
# https://yamllint.readthedocs.io/en/stable/configuration.html
3+
---
4+
extends: default
5+
6+
yaml-files:
7+
- '*.yaml'
8+
- '*.yml'
9+
- '.yamllint'
10+
11+
rules:
12+
line-length:
13+
max: 120
14+
brackets:
15+
min-spaces-inside: 1
16+
max-spaces-inside: 1
17+
comments:
18+
min-spaces-from-content: 1
19+
new-lines:
20+
type: unix

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# =================================
2+
3+
MARKDOWNLINT_CONFIG = ./.config/.markdownlint.yaml
4+
YAMLLINT_CONFIG = ./.config/.yamllint.yaml
5+
6+
# =================================
7+
8+
check-all: check-md check-yaml
9+
10+
# =================================
11+
12+
check-md:
13+
# Using two slashes at the beginning of the paths for Windows bash shell
14+
docker run --rm --tty --network=none --volume="${CURDIR}:/markdown:ro" \
15+
--workdir=//markdown/ \
16+
06kellyjac/markdownlint-cli:0.27.1-alpine \
17+
--config=${MARKDOWNLINT_CONFIG} \
18+
--ignore=./gtest/README.md \
19+
-- ./
20+
21+
check-yaml:
22+
# Using two slashes at the beginning of the paths for Windows bash shell
23+
docker run --rm --tty --network=none --volume="$(CURDIR):/data:ro" \
24+
--workdir=//data/ \
25+
cytopia/yamllint:1.26-0.9 \
26+
-c=${YAMLLINT_CONFIG} \
27+
--strict \
28+
-- ./
29+
30+
# =================================

0 commit comments

Comments
 (0)