forked from duckdb/duckdb-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlint.sh
More file actions
executable file
·34 lines (26 loc) · 923 Bytes
/
Copy pathlint.sh
File metadata and controls
executable file
·34 lines (26 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -xeuo pipefail
fix=''
check='--check --diff'
while getopts "f" opt; do
case $opt in
f) fix="--fix"
check='';;
*) exit
esac
done
npx markdownlint-cli docs/lts/ _posts/ --config .markdownlint.jsonc ${fix} || echo 'markdownlint failed'
black scripts --skip-string-normalization $check || echo 'black failed'
if ! $(which vale); then
echo "Vale binary not found, please install it from https://vale.sh/docs/vale-cli/installation/"
exit 1
fi
vale sync
vale docs/lts/ _library/
if ag --md -l "https://www.youtube.com/embed/"; then
echo 'Found "https://www.youtube.com/embed/ strings, please use "https://www.youtube-nocookie.com/embed/" instead'
if [[ "${fix}" == "--fix" ]]; then
ag --md -l "https://www.youtube.com/embed/" | xargs sed -i 's|https://www.youtube.com/embed/|https://www.youtube-nocookie.com/embed/|g'
fi
exit 1
fi