Skip to content

Commit 7d41f6d

Browse files
format-code: enable markdownlint
Enable markdownlint but allow it to always pass. This will allow maintainers the opportunity to run the tools and fix up their own markdown before we enable this globally. Signed-off-by: Patrick Williams <[email protected]> Change-Id: Ie397a72ca4ef113cdbe433d263ccf3bd5063cf4b
1 parent e795dfe commit 7d41f6d

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

.markdownlint.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
config/markdownlint.yaml

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# openbmc-build-scripts
2+
13
Build script for CI jobs in Jenkins.

config/markdownlint.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
default: true
2+
MD024:
3+
siblings_only: true

jenkins/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Jenkins
2+
13
These are the top level scripts launched by the
24
[OpenBMC Jenkins instance](https://jenkins.openbmc.org):
35

scripts/build-unit-test-docker

+1
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ RUN pip3 install requests
859859
860860
RUN npm install -g \
861861
eslint@latest eslint-plugin-json@latest \
862+
markdownlint-cli@latest \
862863
prettier@latest
863864
"""
864865

scripts/format-code.sh

+11
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ LINTERS_ALL=( \
3434
eslint \
3535
flake8 \
3636
isort \
37+
markdownlint \
3738
prettier \
3839
shellcheck \
3940
)
@@ -209,6 +210,16 @@ function do_isort() {
209210
isort --profile black "$@"
210211
}
211212

213+
LINTER_REQUIRE+=([markdownlint]="markdownlint;.markdownlint.yaml;${CONFIG_PATH}/markdownlint.yaml")
214+
LINTER_IGNORE+=([markdownlint]=".markdownlint-ignore")
215+
LINTER_TYPES+=([markdownlint]="markdown")
216+
function do_markdownlint() {
217+
markdownlint --config "${LINTER_CONFIG[markdownlint]}" \
218+
--disable line-length -- "$@" || \
219+
echo -e " ${YELLOW}Failed markdownlint; temporarily ignoring."
220+
# We disable line-length because prettier should handle prose wrap for us.
221+
}
222+
212223
LINTER_REQUIRE+=([prettier]="prettier;.prettierrc.yaml;${CONFIG_PATH}/prettierrc.yaml")
213224
LINTER_IGNORE+=([prettier]=".prettierignore")
214225
LINTER_TYPES+=([prettier]="json;markdown;yaml")

0 commit comments

Comments
 (0)