From dab667f4586bee5671da2acf86691475523ebcf1 Mon Sep 17 00:00:00 2001 From: chykon <82272369+chykon@users.noreply.github.com> Date: Thu, 23 Feb 2023 16:15:13 +0300 Subject: [PATCH 1/5] Add explicit file search pattern for `markdownlint-cli2` --- .markdownlint-cli2.jsonc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc index 26f1dd119..974ede20f 100644 --- a/.markdownlint-cli2.jsonc +++ b/.markdownlint-cli2.jsonc @@ -5,6 +5,10 @@ "MD041": false }, + "globs": [ + "**/*.md" + ], + "ignores": [ "doc/api/" ] From faaf0db0e53c014927b67884ae1c814af817e580 Mon Sep 17 00:00:00 2001 From: chykon <82272369+chykon@users.noreply.github.com> Date: Thu, 23 Feb 2023 16:16:39 +0300 Subject: [PATCH 2/5] Add Markdown linting script --- tool/lint_markdown_files.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 tool/lint_markdown_files.sh diff --git a/tool/lint_markdown_files.sh b/tool/lint_markdown_files.sh new file mode 100755 index 000000000..89a7000e2 --- /dev/null +++ b/tool/lint_markdown_files.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Copyright (C) 2023 Intel Corporation +# SPDX-License-Identifier: BSD-3-Clause +# +# lint_markdown_files.sh +# Lint Markdown files. +# +# 2023 February 23 +# Author: Chykon + +set -euo pipefail + +npx markdownlint-cli2 From 3da01cc878deee59f7c76d8a7c38c8da6c6918bf Mon Sep 17 00:00:00 2001 From: chykon <82272369+chykon@users.noreply.github.com> Date: Thu, 23 Feb 2023 16:18:18 +0300 Subject: [PATCH 3/5] Add script to check Markdown links --- tool/check_markdown_links.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 tool/check_markdown_links.sh diff --git a/tool/check_markdown_links.sh b/tool/check_markdown_links.sh new file mode 100755 index 000000000..e3505a075 --- /dev/null +++ b/tool/check_markdown_links.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Copyright (C) 2023 Intel Corporation +# SPDX-License-Identifier: BSD-3-Clause +# +# check_markdown_links.sh +# Check Markdown links. +# +# 2023 February 23 +# Author: Chykon + +set -euo pipefail + +config_file='.github/configs/mlc_config.json' +markdown_files=$(find . -path './doc/api' -prune -false -or -type f -name '*.md') + +echo "${markdown_files}" | xargs npx markdown-link-check --quiet --config ${config_file} From 8810ebd12e241f9da91db5e621e7508b9be1c6b7 Mon Sep 17 00:00:00 2001 From: chykon <82272369+chykon@users.noreply.github.com> Date: Thu, 23 Feb 2023 16:19:19 +0300 Subject: [PATCH 4/5] Edit `run_checks.sh` header --- tool/run_checks.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tool/run_checks.sh b/tool/run_checks.sh index 5643e5296..de6acd12f 100755 --- a/tool/run_checks.sh +++ b/tool/run_checks.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022-2023 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # # run_checks.sh @@ -8,7 +8,6 @@ # # 2022 October 11 # Author: Chykon -# set -euo pipefail From 08ab70d81d08b84f4e080cf6c9bf22ef18a87360 Mon Sep 17 00:00:00 2001 From: chykon <82272369+chykon@users.noreply.github.com> Date: Fri, 24 Feb 2023 22:03:00 +0300 Subject: [PATCH 5/5] Add new scripts in `run_checks.sh` --- tool/run_checks.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tool/run_checks.sh b/tool/run_checks.sh index de6acd12f..f4c597aba 100755 --- a/tool/run_checks.sh +++ b/tool/run_checks.sh @@ -30,6 +30,14 @@ trap trap_error ERR printf '\n%s\n' "${form_bold}${color_yellow}Running local checks...${text_reset}" +# Lint Markdown files +print_step 'Lint Markdown files' +tool/lint_markdown_files.sh + +# Check Markdown links +print_step 'Check Markdown links' +tool/check_markdown_links.sh + # Install project dependencies print_step 'Install project dependencies' tool/gh_actions/install_dependencies.sh