diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-10-04 20:56:33 +0200 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-10-10 15:18:55 -0700 |
commit | a296f6bb8d9675debba608324f56cea0d95ad48e (patch) | |
tree | 520b1030e81af217438ecdc87e31196ea246d918 /Meta | |
parent | c06a0bae0417696be8e13d47f3bbd2220bf2e5f8 (diff) | |
download | serenity-a296f6bb8d9675debba608324f56cea0d95ad48e.zip |
Meta: Invoke markdown-checker if available while linting
Diffstat (limited to 'Meta')
-rwxr-xr-x | Meta/check-markdown.sh | 21 | ||||
-rwxr-xr-x | Meta/lint-ci.sh | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Meta/check-markdown.sh b/Meta/check-markdown.sh new file mode 100755 index 0000000000..b663607395 --- /dev/null +++ b/Meta/check-markdown.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eo pipefail + +script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) +cd "${script_path}/.." + +if [ -z "${CHECK_MARKDOWN_BINARY:-}" ] ; then + if ! [ -d Build/lagom/ ] ; then + echo "Directory Build/lagom/ does not exist. Skipping markdown check." + exit 0 + fi + if ! [ -r Build/lagom/markdown-check ] ; then + echo "Lagom executable markdown-check was not built. Skipping markdown check." + echo "To enable this check, you may need to run './Meta/serenity.sh build lagom' first." + exit 0 + fi + CHECK_MARKDOWN_BINARY="Build/lagom/markdown-check" +fi + +find AK Base Documentation Kernel Meta Ports Tests Userland -path 'Ports/*/*' -prune -o -type f -name '*.md' -print0 | xargs -0 "${CHECK_MARKDOWN_BINARY}" README.md diff --git a/Meta/lint-ci.sh b/Meta/lint-ci.sh index fae13831e7..452db6902b 100755 --- a/Meta/lint-ci.sh +++ b/Meta/lint-ci.sh @@ -22,6 +22,7 @@ set +e for cmd in \ Meta/check-ak-test-files.sh \ Meta/check-debug-flags.sh \ + Meta/check-markdown.sh \ Meta/check-newlines-at-eof.py \ Meta/check-style.sh \ Meta/lint-executable-resources.sh \ |