mirror of
https://github.com/rclone/rclone.git
synced 2025-12-12 06:24:14 +01:00
build: add local markdown linting to make check
This commit is contained in:
1
Makefile
1
Makefile
@@ -100,6 +100,7 @@ compiletest:
|
|||||||
check: rclone
|
check: rclone
|
||||||
@echo "-- START CODE QUALITY REPORT -------------------------------"
|
@echo "-- START CODE QUALITY REPORT -------------------------------"
|
||||||
@golangci-lint run $(LINTTAGS) ./...
|
@golangci-lint run $(LINTTAGS) ./...
|
||||||
|
@bin/markdown-lint
|
||||||
@echo "-- END CODE QUALITY REPORT ---------------------------------"
|
@echo "-- END CODE QUALITY REPORT ---------------------------------"
|
||||||
|
|
||||||
# Get the build dependencies
|
# Get the build dependencies
|
||||||
|
|||||||
17
bin/markdown-lint
Executable file
17
bin/markdown-lint
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Run markdown linting locally
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Workflow
|
||||||
|
build=.github/workflows/build.yml
|
||||||
|
|
||||||
|
# Globs read from from $build
|
||||||
|
globs=$(awk '/- name: Check Markdown format/{f=1;next} f && /globs:/{f=2;next} f==2 && NF{if($1=="-"){exit} print $0}' $build)
|
||||||
|
|
||||||
|
if [ -z "$globs" ]; then
|
||||||
|
echo "Error: No globs found in Check Markdown step in $build" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker run -v $PWD:/workdir --user $(id -u):$(id -g) davidanson/markdownlint-cli2 $globs
|
||||||
Reference in New Issue
Block a user