Refactor CI on documentation
This commit is contained in:
parent
e9f3089e90
commit
e8067f4e01
7 changed files with 85 additions and 35 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# This script will run a couple of linter on the documentation
|
||||
|
||||
set -eu
|
||||
|
|
@ -6,14 +6,14 @@ set -eu
|
|||
# We want to run all linters before returning success (exit 0) or failure (exit 1)
|
||||
# So this variable holds the global exit code
|
||||
EXIT_CODE=0
|
||||
readonly BASE_DIR=/app
|
||||
readonly BASE_DIR="${1:-/app}"
|
||||
|
||||
echo "== Linting Markdown"
|
||||
# Uses the file ".markdownlint.json" for setup
|
||||
cd "${BASE_DIR}" || exit 1
|
||||
|
||||
LINTER_EXCLUSIONS="$(find "${BASE_DIR}/content" -type f -name '.markdownlint.json')"
|
||||
GLOBAL_LINT_OPTIONS="--config ${BASE_DIR}/.markdownlint.json"
|
||||
LINTER_EXCLUSIONS="$(find "content" -type f -name '.markdownlint.json')"
|
||||
GLOBAL_LINT_OPTIONS="--config .markdownlint.json"
|
||||
|
||||
# Lint the specific folders (containing linter specific rulesets)
|
||||
for LINTER_EXCLUSION in ${LINTER_EXCLUSIONS}
|
||||
|
|
@ -24,6 +24,6 @@ do
|
|||
done
|
||||
|
||||
# Lint all the content, excluding the previously done`
|
||||
eval markdownlint "${GLOBAL_LINT_OPTIONS}" "${BASE_DIR}/content/**/*.md" || EXIT_CODE=1
|
||||
eval markdownlint "${GLOBAL_LINT_OPTIONS}" "content/**/*.md" || EXIT_CODE=1
|
||||
|
||||
exit "${EXIT_CODE}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue