We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5b74e0 commit eb31283Copy full SHA for eb31283
Makefile
@@ -284,6 +284,9 @@ format:
284
docs-lint:
285
markdownlint . --fix
286
287
+docs-lint-changed:
288
+ ./scripts/linting/lint-changed-md-files.sh
289
+
290
.PHONY: lint lint-fix lint-fix-changed docs-lint docs-lint-changed
291
292
###############################################################################
scripts/linting/lint-changed-md-files.sh
@@ -0,0 +1,13 @@
1
+#!/usr/bin/env bash
2
3
+set -euo pipefail
4
5
+# lint_modified_markdown_files runs the linter only if changes have been made to any md files.
6
+function lint_modified_markdown_files() {
7
+ local markdown_files="$(git diff --name-only | grep \.md$)"
8
+ for f in $markdown_files; do
9
+ markdownlint "${f}" --fix
10
+ done
11
+}
12
13
+lint_modified_markdown_files
0 commit comments