Skip to content

Commit c5c7942

Browse files
authored
[CI] Add pre-commit hook markdownlint with basic config (apache#1391)
1 parent 03d58e3 commit c5c7942

2 files changed

Lines changed: 140 additions & 0 deletions

File tree

.github/linters/.markdown-lint.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
---
19+
# https://github.com/davidanson/markdownlint#rules--aliases
20+
21+
# MD001/heading-increment Heading levels should only increment by one level at a time
22+
MD001: false
23+
24+
# MD003/heading-style Heading style
25+
MD003: false
26+
27+
# MD004/ul-style Unordered list style
28+
MD004: false
29+
30+
# MD005/list-indent Inconsistent indentation for list items at the same level
31+
MD005: false
32+
33+
# MD007/ul-indent Unordered list indentation
34+
MD007: false
35+
36+
# MD009/no-trailing-spaces Trailing spaces
37+
MD009: false
38+
39+
# MD010/no-hard-tabs Hard tabs
40+
MD010: false
41+
42+
# MD012/no-multiple-blanks Multiple consecutive blank lines
43+
MD012: false
44+
45+
# MD013/line-length Line length
46+
MD013: false
47+
48+
# MD014/commands-show-output Dollar signs used before commands without showing output
49+
MD014: false
50+
51+
# MD022/blanks-around-headings Headings should be surrounded by blank lines
52+
MD022: false
53+
54+
# MD023/heading-start-left Headings must start at the beginning of the line
55+
MD023: false
56+
57+
# MD024/no-duplicate-heading Multiple headings with the same content
58+
MD024: false
59+
60+
# MD025/single-title/single-h1 Multiple top-level headings in the same document
61+
MD025: false
62+
63+
# MD026/no-trailing-punctuation Trailing punctuation in heading
64+
MD026: false
65+
66+
# MD027/no-multiple-space-blockquote Multiple spaces after blockquote symbol
67+
MD027: false
68+
69+
# MD028/no-blanks-blockquote Blank line inside blockquote
70+
MD028: false
71+
72+
# MD029/ol-prefix Ordered list item prefix
73+
MD029: false
74+
75+
# MD030/list-marker-space Spaces after list markers
76+
MD030: false
77+
78+
# MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines
79+
MD031: false
80+
81+
# MD032/blanks-around-lists Lists should be surrounded by blank lines
82+
MD032: false
83+
84+
# MD033/no-inline-html Inline HTML
85+
MD033: false
86+
87+
# MD034/no-bare-urls Bare URL used
88+
MD034: false
89+
90+
# MD036/no-emphasis-as-heading Emphasis used instead of a heading
91+
MD036: false
92+
93+
# MD037/no-space-in-emphasis Spaces inside emphasis markers
94+
MD037: false
95+
96+
# MD038/no-space-in-code Spaces inside code span elements
97+
MD038: false
98+
99+
# MD039/no-space-in-links Spaces inside link text
100+
MD039: false
101+
102+
# MD040/fenced-code-language Fenced code blocks should have a language specified
103+
MD040: false
104+
105+
# MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading
106+
MD041: false
107+
108+
# MD045/no-alt-text Images should have alternate text
109+
MD045: false
110+
111+
# MD046/code-block-style Code block style
112+
MD046: false
113+
114+
# MD047/single-trailing-newline Files should end with a single newline character
115+
MD047: false
116+
117+
# MD049/emphasis-style Emphasis style
118+
MD049: false
119+
120+
# MD051/link-fragments Link fragments should be valid
121+
MD051: false
122+
123+
# MD052/reference-links-images Reference links and images should use a label that is defined
124+
MD052: false
125+
126+
# MD058/blanks-around-tables Tables should be surrounded by blank lines
127+
MD058: false
128+
129+
# MD059/descriptive-link-text Link text should be descriptive
130+
MD059: false

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,13 @@ repos:
126126
description: check Python code for security issues
127127
args: ['-c=pyproject.toml']
128128
additional_dependencies: ['bandit[toml]']
129+
- repo: https://github.com/igorshubovych/markdownlint-cli
130+
rev: a4d5d37e66ebcd6b3705204a1d6dbb56dea66338 # frozen: v0.49.0
131+
hooks:
132+
- id: markdownlint
133+
name: run markdownlint
134+
description: check Markdown files with markdownlint
135+
args: [--config=.github/linters/.markdown-lint.yml]
136+
exclude: ^\.github/.*$
137+
types: [markdown]
138+
files: \.md$

0 commit comments

Comments
 (0)