Skip to content

Commit cc20dd2

Browse files
Add automated markdown linting (openhab#1415)
* Added Markdownlint action. Signed-off-by: Jerome Luckenbach <[email protected]> * Fix action yml file. Signed-off-by: Jerome Luckenbach <[email protected]> * Fix action yml file. Signed-off-by: Jerome Luckenbach <[email protected]> * Fix action yml file. Signed-off-by: Jerome Luckenbach <[email protected]> * Define proper run parameters and fix markdown styleguide aside. Signed-off-by: Jerome Luckenbach <[email protected]> * Leave out pull request triggers for the start. Signed-off-by: Jerome Luckenbach <[email protected]>
1 parent 061cece commit cc20dd2

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

.github/markdownStyle.rb

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
all
2+
3+
# Expect dash usage for unorderd lists
4+
rule 'MD004', :style => :dash
5+
6+
# Allow long line lengths
7+
exclude_rule 'MD013'
8+
9+
# Allow Multiple top level headers in the same document
10+
exclude_rule 'MD025'
11+
12+
# Allow inline HTML
13+
exclude_rule 'MD033'

.github/workflows/markdownlint.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- '2.5.x'
8+
tags-ignore:
9+
- '**'
10+
# pull_request:
11+
# branches:
12+
# - main
13+
# types: [open,synchronize,reopen]
14+
15+
jobs:
16+
markdownlint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
20+
- name: Check out code
21+
uses: actions/checkout@v2
22+
23+
- name: Run markdownlint (mdl)
24+
uses: bewuethr/[email protected]
25+
with:
26+
style-file: .github/markdownStyle.rb

styleguide.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ First and foremost we are following the recommendations given at: [https://www.c
1616
An ordered list:
1717

1818
1. Some text
19-
2. Some more text
19+
1. Some more text
2020

2121
An unordered list:
2222

@@ -25,9 +25,9 @@ An unordered list:
2525

2626
An unordered loose list (applied if bigger or with nested lists):
2727

28-
- Some text
29-
- An indented item, making the list "loose"
28+
- Some text
29+
- An indented item, making the list "loose"
3030

31-
- Some more text
31+
- Some more text
3232

33-
- And even more text that could also strech over multiple lines
33+
- And even more text that could also strech over multiple lines

0 commit comments

Comments
 (0)